4. Find all pairs $(p, q)$ of real numbers such that the polynomial $x^{2}+p x+q$ is a divisor of the polynomial $x^{4}+p x^{2}+q$.

---

Note: The translation preserves the original formatting and structure of the text.
SOLUTION. By dividing the polynomial $x^{4}+p x^{2}+q$ by the polynomial $x^{2}+p x+q$, we find that

$x^{4}+p x^{2}+q=\left(x^{2}+p x+q\right)\left(x^{2}-p x+p^{2}+p-q\right)+\left(2 p q-p^{3}-p^{2}\right) x+q-p^{2} q-p q+q^{2}$.

The polynomial $x^{2}+p x+q$ is a divisor of the polynomial $x^{4}+p x^{2}+q$ if and only if the remainder $\left(2 p q-p^{3}-p^{2}\right) x+q-p^{2} q-p q+q^{2}$ is the zero polynomial, that is, if and only if

$$
2 p q-p^{3}-p^{2}=p\left(2 q-p^{2}-p\right)=0
$$

$$
q-p^{2} q-p q+q^{2}=q\left(1-p^{2}-p+q\right)=0 .
$$

If $p=0$, then $q=0$ or $q=-1$.

If $q=0$, then $p=0$ or $p=-1$.

If $p \neq 0$ and $q \neq 0$, then $2 q-p^{2}-p=0$ and $1-p^{2}-p+q=0$ must hold. From the second equation, we express $q=p^{2}+p-1$. Substituting into the first equation, we get $2 p^{2}+$ $+2 p-2-p^{2}-p=p^{2}+p-2=(p+2)(p-1)=0$ and thus $p=1, q=1$ or $p=-2$, $q=1$.

Therefore, five pairs $(p, q)$ satisfy the conditions, namely $(0,0),(0,-1),(-1,0),(1,1),(-2,1)$.