Determine $f \circ g$ for the following functions: $$ f(x) = \begin{cases} -x, & x < 0\\ x+1, & x \ge 0 \end{cases} \quad \text{and} \quad g(x) = \begin{cases} x^2, & x \le 2\\ x+2, & x > 2 \end{cases} $$
I need some help with this exercise. I have no issues with finding the composition $f(g(x))$. But I don't have an idea how to do it when four functions are given.
HINT
Well, if $x > 2$ then $g(x) = x+2 > 4$ so $f(g(x)) = (x+2)+1$.
Otherwise, if $x \le 2$, then $g(x) = x^2 \le 4$ and $g(x) \ge 0$ since a square of a number is always positive. Can you finish this?