8. The function $J(x)$ is defined by:
$$
J(x)=\left\{\begin{array}{ll}
4+x & \text { for } x \leq-2, \\
-x & \text { for }-20 .
\end{array}\right.
$$

How many distinct real solutions has the equation $J(J(J(x)))=0$ ?
Solution
004

The only solutions to $J(x)=0$ are $x=0,-4$.
Since $J(0)=0$, both will also be solutions of $J(J(J(x)))=0$.
Any solution to $J(x)=-4$ will also be a solution to $J(J(x))=0$. The only solution to $J(x)=-4$ is $x=-8$. Since $J(x)=0, x=-8$ is also a solution of $J(J(J(x)))=0$.
Any solution to $J(x)=-8$ will also be a solution to $J(J(J(x)))=0$. The only solution to $J(x)=-8$ is $x=-12$.
Therefore, there are four distinct solutions, $x=0,-4,-8$ and -12 .