5. Solve the system of equations

$$
\left\{\begin{array}{l}
x+y=z^{2} \\
y+z=x^{2} \\
z+x=y^{2}
\end{array}\right.
$$
5. Answer. $(0,0,0)$ and $(2,2,2)$.

Subtract the second equation from the first, we get

$$
x-z=z^{2}-x^{2} \text {, that is } x-z=(z-x)(z+x) \text {. }
$$

Considering that $z+x=y^{2}$, we arrive at the equation $x-z=(z-x) y^{2}$.

Subtracting the third equation from the second, by similar reasoning we get the equation $y-x=(x-y) z^{2}$.

Thus, we arrive at the consequence of the original system

$$
\left\{\begin{array}{l}
x-z=(z-x) y^{2} \\
y-x=(x-y) z^{2}
\end{array}\right.
$$

Transform the last system to the form:

$$
\left\{\begin{array}{l}
(x-z)\left(1+y^{2}\right)=0 \\
(y-x)\left(1+z^{2}\right)=0
\end{array}\right.
$$

Thus, it is proven that if the original system has a solution, then $x=y=z$ and $2 x=x^{2}$.

Therefore, the system can have only two solutions: $x=y=z=0$ and $x=y=z=2$. There are no other solutions.

By verification, we confirm that $(0,0,0)$ and $(2,2,2)$ are solutions to the system.