If $f$ continuous and $f(x^2) = f(x)$, then $f$ is a const 
Problem: Given $f:[0,1] \rightarrow \mathbb{R}$ ($f$ continuous ) and $f(x^2) = f(x)$ $\forall x \in [0,1]$. Show that function $f$ is a const.

 A: Consider the sequence $a,a^2,a^4,a^8,\ldots$ i.e. $x_n = a^{2^{n}}$ where $a \in [0,1)$.
Clearly, we have $\displaystyle \lim_{n \rightarrow \infty} x_n = 0$.
We have $f(a) = f(a^2)$, $\forall a \in [0,1]$.
Using this, it is easy to prove by induction that $f(a) = f(a^{2^{n}})$, $\forall a \in [0,1]$ and $\forall n \in \mathbb{N}$
Further, every continuous function is sequentially continuous i.e. $\displaystyle \lim_{n \rightarrow \infty} f(x_n) = f(\lim_{n \rightarrow \infty} x_n) $.
Hence, $\displaystyle \lim_{n \rightarrow \infty} f(x_n) = f(\lim_{n \rightarrow \infty} x_n)$.
Using the above arguments, we get that $\forall a \in [0,1)$, $$f(a) = \displaystyle \lim_{n \rightarrow \infty} f(a) = \displaystyle \lim_{n \rightarrow \infty} f(a^{2^{n}}) = f(\displaystyle \lim_{n \rightarrow \infty} a^{2^{n}}) = f(0)$$
Hence, $f(a) = f(0)$, $\forall a \in [0,1)$. Use continuity to conclude that $f(1) = f(0)$ and hence $$f(a) = f(0), \forall a \in [0,1]$$
EDIT
I just want to make this argument symmetric for $0$ and $1$.
Just like we argued out that $f(a) = f(0)$, $\forall a \in [0,1)$, we can argue out that $f(a) = f(1)$, $\forall a \in (0,1]$.
Instead of considering the sequence $a,a^2,a^4,a^8,\ldots$ consider $a, \sqrt{a}, \sqrt[4]{a}, \sqrt[8]{a}, \ldots$ i.e. $x_n = \sqrt[2^n]{a}$ where $a \in (0,1]$.
Clearly, we have $\displaystyle \lim_{n \rightarrow \infty} x_n = 1$.
We have $f(a) = f(\sqrt{a})$, $\forall a \in [0,1]$.
Using this, it is easy to prove by induction that $f(a) = f(\sqrt[2^n]{a})$, $\forall a \in [0,1]$ and $\forall n \in \mathbb{N}$
Further, every continuous function is sequentially continuous i.e. $\displaystyle \lim_{n \rightarrow \infty} f(x_n) = f(\lim_{n \rightarrow \infty} x_n) $.
Hence, $\displaystyle \lim_{n \rightarrow \infty} f(x_n) = f(\lim_{n \rightarrow \infty} x_n)$.
Using the above arguments, we get that $\forall a \in (0,1]$, $$f(a) = \displaystyle \lim_{n \rightarrow \infty} f(a) = \displaystyle \lim_{n \rightarrow \infty} f(\sqrt[{2^{n}}]{a}) = f(\displaystyle \lim_{n \rightarrow \infty} \sqrt[{2^{n}}]{a}) = f(1)$$
Hence, $f(a) = f(1)$, $\forall a \in (0,1]$.
So we have that $f(0) = f(a) = f(1)$, $\forall a \in [0,1]$.
