Answer
$f(x)=\left\{\begin{array}{l}
1~~~~~~\ \mathrm{i}\mathrm{f}~~\mathrm{x}\ \leq-1\\
-1~~~\ \mathrm{i}\mathrm{f}~~\mathrm{x}\ \gt 2
\end{array}\right.$
Domain: $(-\infty,\ -1]\ \cup(2,\ \infty)$
Range: $\{-1,1\}$
Work Step by Step
We see that the graph consists of two horizontal lines $y=1$ and $y=-1$. The region between $x=-1$ and $x=2$ is excluded. Solid circles indicate that the value belongs to that piece of the function (e.g. "$\leq$" or "$\geq$"), while open circles indicate that the value does not (e.g. "$\lt$" or "$\gt$"). Thus we have:
$f(x)=\left\{\begin{array}{l}
1~~~~~~\ \mathrm{i}\mathrm{f}~~\mathrm{x}\ \leq-1\\
-1~~~\ \mathrm{i}\mathrm{f}~~\mathrm{x}\ \gt 2
\end{array}\right.$
We see that the domain consists of all real numbers, with the region between $x=-1$ and $x=2$ is excluded (-1 itself is included, while 2 is excluded). The range is either -1 or 1:
Domain: $(-\infty,\ -1]\ \cup(2,\ \infty)$
Range: $\{-1,1\}$