I found an interesting question from a Chinese maths textbook but did not obtain the full results stated.
Question: Let $f(x)$ be a quadratic function of the form $x^2+px+q$ such that the equation $f(f(x))$ $=0$ has two equal real roots. Show that $p$ $\geqslant$ $0$ and $q$ $\geqslant$ $0$.
It is easy to show that $q$ $\geqslant$ $0$ by using the discriminant $b^2-4ac=0$ for the equation $f(f(x))$ $=0$. However, the proof that $p$ $\geqslant$ $0$ is still unknown. Can somebody help me with it?
Since $f(f(x))=0$ does have a solution, $f(x)$ can be factored, into say $f(x)=(x-\alpha)(x-\beta)$. Here, we have $\alpha+\beta=-p,\alpha\beta=q.$
If $\alpha=\beta,$ you can show $\alpha$ and $\beta$ must be $0$. In this case, we have $p=q=0.$
Now, assume $\alpha\neq \beta.$ Then, $f(f(x))=(f(x)-\alpha)(f(x)-\beta)=0$ is equivalent to $f(x)-\alpha=0$ or $f(x)-\beta=0.$ Since both of these equations cannot be true at the same time (since $\alpha\neq \beta$), and $f(f(x))=0$ has only one solution, it must be the case that one of the two equations has only one root (i.e., a double root), and the other no roots.
Without loss of generality, we can assume $f(x)-\alpha=0$ has a double root, and $f(x)-\beta=0$ has no roots. Looking at the discriminant, we get $(-\alpha-\beta)^2-4(\alpha\beta-\alpha)=0$ and $(-\alpha-\beta)^2-4(\alpha\beta-\beta)<0.$
Now, we have $(-\alpha-\beta)^2-4(\alpha\beta-\alpha)=(\alpha-\beta)^2+4\alpha=0,$ so $\alpha\le 0.$ Similarly, we have $\beta<0.$ Hence, $p=-\alpha-\beta\ge 0,$ and $q=\alpha\beta\ge 0.$