4. For which quadratic function $f(x)$ does there exist a quadratic function $g(x)$ such that the roots of the equation $g(f(x))=0$ are four different consecutive terms of an arithmetic sequence and simultaneously $i$ roots of the equation $f(x) g(x)=0$?

(P. Černek)
Solution. From the problem statement, it follows that each of the equations $f(x)=0, g(x)=0$ has two real roots, and all four roots of the considered equations are distinct. Let $x_{1}, x_{2}$ be the roots of the equation $f(x)=0$. Therefore, $f(x)=a\left(x-x_{1}\right)\left(x-x_{2}\right)$, where $a$ is a real number, $a \neq 0$. The number $x_{1}$ is also a root of the equation $g(f(x))=0$, so $g\left(f\left(x_{1}\right)\right)=g(0)=0$. This implies that the equation $g(x)=0$ has one root 0. Let $b(b \neq 0)$ be the second root of this equation. Thus, $g(x)=c x(x-b)$, where $c$ is a real number, $c \neq 0$. The numbers 0 and $b$ are also roots of the equation $g(f(x))=0$:

$$
g(f(0))=c f(0)(f(0)-b)=0 \quad \text{and} \quad g(f(b))=c f(b)(f(b)-b)=0.
$$

Since the numbers 0 and $b$ cannot be roots of the equation $f(x)=0$, it follows that $f(0)=f(b)=b$.

Therefore, on the number line, both the points 0 and $b$, as well as the points $x_{1}$ and $x_{2}$, are symmetrically paired according to the $x$-coordinate of the vertex of the parabola $y=f(x)$. The numbers $0, b, x_{1}$, and $x_{2}$ (forming an arithmetic sequence according to the problem statement) can thus be arranged in two ways:
- The numbers 0 and $b$ lie outside the interval with endpoints $x_{1}$ and $x_{2}$. Then $x_{1}=-\frac{b}{3}$ and $x_{2}=-\frac{2b}{3}$ (with a suitable choice of indices), so

$$
b=f(0)=a\left(-\frac{b}{3}\right)\left(-\frac{2 b}{3}\right)=\frac{2 a b^{2}}{9}
$$

thus $b=\frac{9}{2 a}$ and

$$
f(x)=a\left(x-\frac{3}{2 a}\right)\left(x-\frac{3}{a}\right)=a x^{2}-\frac{9}{2} x+\frac{9}{2 a}.
$$

- The numbers 0 and $b$ lie within the interval with endpoints $x_{1}$ and $x_{2}$. Then $x_{1}=-b$ and $x_{2}=2 b$ (with a suitable choice of indices), so

$$
b=f(0)=a b(-2 b)=-2 a b^{2}
$$

thus $b=-\frac{1}{2 a}$ and

$$
f(x)=a\left(x-\frac{1}{2 a}\right)\left(x+\frac{1}{a}\right)=a x^{2}+\frac{1}{2} x-\frac{1}{2 a}.
$$

Conclusion: The problem is satisfied by all quadratic functions $f$ of the form

$$
f(x)=a x^{2}-\frac{9}{2} x+\frac{9}{2 a} \quad \text{or} \quad f(x)=a x^{2}+\frac{1}{2} x-\frac{1}{2 a}
$$

where $a$ is any non-zero real number.