It is easier to produce some equations using cases. This is used when already in mathmode. It is possible to use the cases environment and it will not be interfered with by line breaking hence it should only be used for relatively narrow structures that will not need line breaking at any realistic font size.
\begin{equation*} f(x) = \begin{cases} x^2 & \text { if } x\geq 0\\ -x & \text { if } x<0 \end{cases}\end{equation*}