1. Find all complex numbers $z$ such that
$$
P(x)=(x-z)\left(x-z^{2}\right)\left(x-z^{3}\right)\left(x-z^{4}\right)
$$

has all real coefficients.
1. Obviously, all real numbers satisfy the condition.

Below, assume $z$ is not a real number.
If $z^{\prime}$ is a root of $P$, then $z^{\prime}$ is also a root of $P$.
Thus, $\bar{z}=z^{2}$ or $\bar{z}=z^{3}$ or $\bar{z}=z^{4}$.
(1) From $|z|=|z|^{2}(z \neq 0)$, we get $|z|=1$.
Then $z^{3}=z^{2} z=\bar{z} z=|z|^{2}=1$.
Thus, the factors $(x-z)\left(x-z^{2}\right)$ and $x-z^{3}$ of $P$ are all real coefficients.
Therefore, $z^{4}=z^{3} z=z$ is a real number, which is a contradiction.
(2) From $\bar{z}=z^{3}$, we get $z^{4}=1$. Then $z= \pm \mathrm{i}$ and satisfies the condition.
(3) From $\bar{z}=z^{4}$, we get $z^{5}=1$.
Then $z=\cos \frac{2 k \pi}{5}+\mathrm{i} \sin \frac{2 k \pi}{5}(k=1,2,3,4)$.
From $\bar{z}^{2}=z^{5} \bar{z}^{2}=z^{3} z^{2} \bar{z}^{2}=z^{3}|z|^{4}=z^{3}$, we know that the factors $(x-z)\left(x-z^{4}\right)$ and $\left(x-z^{2}\right)\left(x-z^{3}\right)$ of $P$ are all real coefficients.
Thus, $P$ is a polynomial with real coefficients.
Therefore, $z \in\{ \pm \mathrm{i}\} \cup\left\{\left.\cos \frac{2 k \pi}{5}+\mathrm{i} \sin \frac{2 k \pi}{5} \right\rvert\, k=1\right.$,
$2,3,4\} \cup \mathbf{R}$.