Suppose that $f(x)$ is continuous on $(0, \infty)$ such that for all $x > 0$,$f(x^2) = f(x)$. Prove that $f$ is a constant function. Suppose that $f(x)$ is continuous on $(0, +\infty)$ such that for all $x > 0$,$f(x^2) = f(x)$. Prove that $f$ is a constant function. My attempt is to show that for any point $a \neq b$ , we have $f(a)=f(b)$. But I have no idea on how to get this. Anyone can help?
 A: Hint: 
$$\begin{align}f(x^2)=f(x)=f(\sqrt{x})= \cdots=& f(x^{\frac{1}{2^n}})
\\
f((x+1)^2)=f(x+1)=f(\sqrt{x+1})= \cdots=& f((x+1)^{\frac{1}{2^n}})
\\
\vdots\hspace{ 1 cm }=\cdots=&\hspace{ 1 cm }\vdots 
\\
f((x+k)^2)=f(x)=f(\sqrt{x+n})= \cdots=& f((x+k)^{\frac{1}{2^n}}) \end{align}$$
Or try showing there is NO such function which is continuous at $(0, +\infty)$ by contradiction. 
A: As I understand it:
$$f(x) = f(x^2)\quad  \Rightarrow$$
$$ f(x^\frac{1}{2}) = f(x)\quad \Rightarrow$$
$$f(x) = f(x^\frac{1}{2^n})_{n \in N}$$
take $a,b \in (0,+\infty)$, then:
$$f(a) =\lim_{n\rightarrow\infty} f(a^\frac{1}{2^n})=f(1)$$
$$f(b) =\lim_{n\rightarrow\infty} f(b^\frac{1}{2^n})=f(1)$$
$$f(a)=f(b)\Rightarrow_{def}\mathtt {f\quad is\quad constant}$$
Is it correct? Is it rigorous? My thought process was: continuity has limit in its definition, so I probably have to use lim in writing my proof.
A: Try proving the statement using contradiction.  Suppose that $f(x^2) = f(x)$ for all $x$ and that there is a point $a$ such that $f(a) \neq f(1)$.  Prove that $f$ cannot be continuous at $x=1$.
A: First it's useful to find the constant. That's easy, it would be $C = f(1)$. 
Now assume that $f(x) = D$ for some $x > 1$ and some $D \ne C$. Then there is a smallest $x_0 > 1$ with this property. What is $f( \sqrt{x_0})$? Can you get to a contradiction from there? How do you handle the case $x < 1$?
