Let $f\colon(-1,1)\to \mathbb{R}$ be a real valued function. $f$ is continuous at $0$ with $f(0)=k$. If $f(x)=f(x^2)$ for all $x\in (-1,1)$ then $f(x)=k$ for all $x$ in domain.
I am trying to prove it rigorously. It is given to me that $f$ is continuous at $0$. By definition, it means
for every $\epsilon>0$, there exists a $\delta>0$ such that $|x-0|<\delta\implies |f(x)-k|<\epsilon$
Now $f(x)=f(x^2)$ so that means we also have $|f(x^2)-k|<\epsilon$
But I am not able to proceed further here. I request you to give me some hints so that I can solve it on my own.
Edit (after positing the question magically I got some idea:)):
I take the sequence $s_n=x^{2n}$.Since $|x|<1$, then $\lim_{n\to\infty} f(x^{2n})=f(0)$. Therefore $f(x)=k$ as $f(x^{2n})=f(x)$
Edit 2: The above sequence is incorrect. We have to take $s_n=x^{2^n}$. I thank @Kavi for pointing it out.
You have made a mistake. You get $f(x)=f(x^{2^{n}})$, not $f(x)=f(x^{2n})$. Since $f(x)=f(x^{2^{n}})$ for any positive integer $n$ (by a simple induction argument), and for $|x|<1$ we have $x^{2^{n}}\to 0$ we get $f(x^{2^{n}}) \to f(0)=k$. Hence $f(x)=k$ for any $x$.