TeX source:
f(x)=\left\{ \begin{array} {lll} 1 & \text { if } x ≤ -1 \\1 -x & \text { if } -1 ≤ x ≤ 1 \\ 2 & \text { if } 1 < x \end{array} \right.