$g(x)$ is continuous on $\mathbb{R}$ st $g(x)=g(x^2)$. Prove that $g(x)$ is constant.

My phrasing would be as follows:

Since $g(x)=g(x^2)$ for any $x$, given $x_0\ne 0$, we have that $$g(x_0)=g(x_0^2)=g((-x_0)^2)=g(-x_0),$$ so it suffices to consider $x_0>0$. In this case we have $$g(x_0)=g(x_0^{1/2})=g(x_0^{1/2})=g(x_0^{1/4})=\cdots =g(x_0^{1/2^n})=\cdots$$ Given an $\epsilon>0$, there is a $\delta$ so that $x\in (1-\delta,1+\delta)$ implies $|g(x)-g(1)|<\epsilon$. In particular, since we can choose a high enough $n$ so that $x_0^{1/{2^n}}\in (0,\delta)$, so $g(x_0)=g(1)$. So $g$ is constant on $\mathbb{R}\setminus \{0\}$, from which we easily obtain by continuity that $g$ is constant on $\mathbb{R}$.


The proof is essentially correct, but a bit too brief. The part "$g(x)=g(1)$ for all $x=0$" is written nicely. For $x<0$, I would write instead: $g(x)=g(x^2)=g(1)$, where the second equality holds since $x^2>0$. And as Jean Claude Arbaut added, the proof should conclude with $g(0)=\lim_{x\to 0}g(x) = g(1)$.