TeX source:
f(x)=\left\{\begin{array}{ccc}x^{2} & \text { if } & x \leq 1 \\ 3 & \text { if } & 1 < x \leq 2 \\ x & \text { if } & x > 2\end{array}\right.