<s>[INST] Defining a piecewise function using restricted operations Question
Can the piecewise function
$$f(x) = \begin{cases}
    0 & \text{if $x > 0$} \\
    1 & \text{if $x = 0$} \\
    0 & \text{if $x < 0$} \\
\end{cases}$$
be defined using only the operations $+ , -, *, /, |\cdots|, \max$, and $\min$?

What I have tried
I can define the first and last pieces: $0$ if $x > 0$ or $x < 0$ with
$$1 - \frac{x}{x}$$
But this will fail with a division by $0$ in the case where $x = 0$
$$1 - \frac{0}{0}$$
I can fix the division error by forcing a 1 on the bottom.
$$a(x) = 1 - \frac{x}{\max(1, x) \min(-1, x)}$$
This works for most negatives and $0$ and fails when $-1 < x < 0$ and $x > 0$. When $x > 0$, $a(x) = 2$. Fixing this requires another max to check a number is positive. Defining $b(x)$ to be $2$ when $x > 0$ and $0$ when $x = 0$ or $x <= -1$ 
$$b(x) = 2\frac{\max(0, x)}{\max(1, x) \min(-1, x)}$$
Combining them to get
$$c(x) = a(x) - b(x) = 1 - \frac{x - 2\max(0, x)}{\max(1, x) \min(-1, x)}$$
This mess is what I want except when $-1 < x < 0$ and $0 < x < 1$. This is as far as I have gotten.
 [/INST] You asked how to define your function with an infinite number of operations
from your list.
Here it is defined by means of an infinite sum:
$$
f(x) =
  \max(0,1-|x|)
 + \frac12\sum_{n=1}^\infty (\min(1,|2^n x+1|) + \min(1,|2^n x-1|) - 2).
$$
The first part of this, $\max(0,1-|x|),$ is zero except for $-1<x<1,$
where its graph is an isoceles triangle whose vertices are
$(-1,0),$ $(1,0),$ and $(0,1)$.
Each of the terms of the sum is zero except for 
$-\frac{2}{2^n}<x<\frac{2}{2^n},$ where its graph consists of two
isoceles triangles with vertices at
$\left(-\frac{2}{2^n},0\right),$ $(0,0),$ and 
$\left(-\frac{1}{2^n},-1\right)$ (first triangle)
and at $(0,0),$ $\left(\frac{2}{2^n},0\right),$ and 
$\left(\frac{1}{2^n},-1\right)$ (second triangle).
The function 
$$
f_m(x) =
  \max(0,1-|x|)
 + \frac12\sum_{n=1}^m (\min(1,|2^n x+1|) + \min(1,|2^n x-1|) - 2)
$$
defined by taking only a partial sum is zero everywhere except
for $-\frac{1}{2^m}<x<\frac{1}{2^m},$
where its graph is an isoceles triangle with vertices
$\left(-\frac{1}{2^n},0\right),$ $\left(\frac{1}{2^n},0\right),$ and 
$(0,1).$
So for any $x\neq 0,$ $f_m(x) = 0$ whenever $m$ is large enough,
whereas $f_m(0) = 1$ for all $m.$
</s>