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