# All functions that satisfy $f(x)^n = f(x^n)$

What are all the functions that satisfy $f(x)^n = f(x^n)$ for real $(x,n)$. Clearly the identity works anything else? I cannot find a proof.

• $x^a$ works, and of course the constants $0,1$. – lulu Jul 2 '17 at 22:57
• For all real $x,n$? Or just all $x$? – kingW3 Jul 2 '17 at 22:58
• – dxiv Jul 2 '17 at 22:59
• Let $g(\ln(x))=\ln(f(x))$, then $g(nx)=ng(x)$ for positive $x$, which is pretty easy to solve. – Kitegi Jul 2 '17 at 23:01

There are some issues if you assume $x$ and $n$ can be any real numbers, since things like $(-1)^{1/2}$ aren't well-defined. If you're looking for continuous real-valued solutions, then the power functions are essentially the only ones, even if we assume only that the identity holds for $n=2,3$.
Let us suppose that $f:\mathbb{R}\to\mathbb{R}$ is continuous and not indentically $0$, and that $$f(x^2)=f(x)^2,$$ $$f(x^3)=f(x)^3$$ for all real $x$. Take $x>0,x\neq 1$. Using the two functional equations, we have $$f(x^{2^m/3^n})=f(x)^{2^m/3^n}$$ for any nonnegative integers $m,n$. Now as $m,n$ vary, we can make $2^m/3^n$ arbitrarily close to any positive real number we wish (because $\log_2 3$ is irrational). By the continuity of $f$, this means that $$f(x^{\alpha})=f(x)^{\alpha}$$ for all $\alpha>0$.
Now letting $x=2$ and writing $f(2)=C$ (which is nonzero since $f\not\equiv 0$ and $f$ is continuous), we have $$f(2^{\alpha})=f(2)^\alpha=C^\alpha$$ for all $\alpha>0$. Hence, $f(x)=x^{\log_2 C}$ for all $x>1$. Similarly, $f$ is a (possibly different) power function on the interval $[0,1]$. Finally, since $f(-x)^2=f(x^2)$, $f(-x)$ is just $\pm f(x)$ for $x>0$. Hence, the nonzero solutions are $$f(x)=\begin{cases}x^a,\;0\le x\le 1,\\ x^b,\;x>1,\\ |x|^a,\;-1\le x\le 0,\\ |x|^b,\;x<-1,\end{cases}$$ and $$f(x)=\begin{cases}x^a,\;0\le x\le 1,\\ x^b,\;x>1,\\ -|x|^a,\;-1\le x\le 0,\\ -|x|^b,\;x<-1,\end{cases}$$ where $a\ge 0$ and $b$ can be any real number (we cannot have $a$ be negative, since then $f$ would be discontinuous at $0$).