Define $f(x),g(x)\in \mathbb{R}$. Prove $f(x)=g(x)$.

Problem: Define $f(x),g(x)\in \mathbb{R}$ are polynomials and both of them have at least one real root and satisfy: $$f(1+x+g(x)^{2})=g(1+x+f(x)^{2}),\forall x\in\Bbb{R}$$ Prove $f(x)\equiv g(x)$.

Rather naturally, I define $m(x)=1+x+g(x)^{2}$, $n(x)=1+x+f(x)^{2}$. Then from the first equation we have: $$m(n(x))-n(x)=n(m(x))-m(x)\iff m(n(x))-n(m(x))=n(x)-m(x)$$

From here, I think maybe we can use the difference between 2 sides.

I have made a change for the problem. How about now, can we solve it?


If $g-f$ has a root, then you can iterate one root to obtain many roots. In fact, for $f$ and $g$ so defined, $g-f\equiv 0$ if and only if $g-f$ has at least one real root.

Proof:


$(\implies)$ Obvious.

$(\impliedby)$ Suppose for the sake of a contradiction that the polynomial $(g-f)(x)$ is not identically $0$ but has a real root, say $y_1=x_0$. Of course, then $(g-f)(x)$ is of finite degree, say $k$, and thus has $k$ roots in $\mathbb{C}$. Call $\alpha=f(x_0)=g(x_0)$. Observe that $g(1+x_0+\alpha^2)=f(1+x_0+\alpha^2)$ since $f(x_0)=g(x_0)$. Hence, the polynomial $(g-f)(x)$ has another root at $y_2=1+x_0+\alpha^2$. Noting that $(g-f)(y_2)=0$, we can repeat this process obtaining another, distinct, real root $y_3=1+y_2+f(y_2)^2$ of $g-f$. Observe $y_1<y_2<y_3$.

Continuing in this manner $k+1$ times, you will have exhausted all roots of $(g-f)(x)$ and have found a distinct, $k+1$-st root of $g-f$, which is a contradiction since $g-f$ can have at most $k$ roots over $\mathbb{R}$.


Whence the equivalence of these statements. Now we need only show $g-f$ has a root, as this is equivalent to $g-f\equiv 0$.

Proof:


Suppose for the sake of a contradiction that $f$ and $g$ have no common, real roots.

Let $x_1$ be the largest real root of $f$ and $x_2$ be the largest real root of $g$. WLOG suppose that $x_1<x_2$ (we can modify the following argument when $x_2<x_1$ in the obvious way). Then for $x>x_1$, either $f$ is increasing and $f(x)>0$ or $f$ is decreasing and $f(x)<0$.

Observe that $$(g-f)(1+x+f(x)^2)=f(1+x+g(x)^2)-f(1+x+f(x)^2)$$ and notice that, by our contrivance, for all $x\ge x_1$, $f(1+x+g(x)^2)$ and $f(1+x+f(x)^2)$ have the same sign.

Thus $$(g-f)(1+x_1+f(x_1)^2)=f(1+x_1+g(x_1)^2)-f(1+x_1)$$ and $$(g-f)(1+x_2+f(x_2)^2)=f(1+x_2)-f(1+x_2+f(x_2)^2)$$ have different signs since $1+x_1+g(x_1)^2>1+x_1$, and $1+x_2<1+x_2+f(x_2)^2$ and for $x>x_1$, $f$ is either increasing or decreasing. Hence, by the intermediate value theorem there exists such a zero in $(x_1,x_2)$ of $g-f$, which is a contradiction since we assumed $f$ and $g$ had no common roots.