Answer
$f(x)=\begin{cases} 1,\ x\lt 0 \\ 0,\ x=0 \\ 1,\ x\gt 0\end{cases}$
domain $(-\infty,\infty)$ and range $\{0, 1 \}$
Work Step by Step
Step 1. Identify the left line equation as $y=1$ with $x\lt 0$.
Step 2. Identify the right line equation as $y=1$ with $x\gt 0$.
Step 3. Identify the middle point as $y=0$ with $x=0$
Step 4. Combine the above to get: $f(x)=\begin{cases} 1,\ x\lt 0 \\ 0,\ x=0 \\ 1,\ x\gt 0\end{cases}$
Step 5. Identify the domain as $(-\infty,\infty)$ and range as $\{0, 1 \}$