How to find the function $f$ given $f(f(x)) = 2x$?

I was wondered how to find the function in this equality:

$f(f(x))=2x$. Also $f$ is continuous.

I don't need the answer, how to find it is more important.


Solution 1:

If $f$ has a power series, you could try composing the power series. Since $f(0)=0$, we don't need to translate: $$ f(x) = a_1x+a_2x^2+a_3x^3+\dots $$ Therefore, $$ \begin{align} f(f(x)) &= a_1(a_1x+a_2x^2+a_3x^3+\dots)\\ &+a_2(a_1x+a_2x^2+a_3x^3+\dots)^2\\ &+a_3(a_1x+a_2x^2+a_3x^3+\dots)^3\\ &+\dots\\ &=a_1^2x+a_1a_2(1+a_1)x^2+a_1(2a_2^2+a_3+a_1^2a_3)x^3+\dots\tag{1} \end{align} $$ Using $(1)$, we get that $a_1=\sqrt{2}$ or $a_1=-\sqrt{2}$, then $a_2=0$, and $a_3=0$. Checking, we see that both $f(x)=\sqrt{2}\;x$ and $f(x)=-\sqrt{2}\;x$ work.

Addition: Using alex.jordan's comment that $f(2x)=2f(x)$, if $f^{\;\prime}\in\operatorname{Lip}(\alpha)$ for some $\alpha>0$, i.e. $f\in\operatorname{Lip}(1+\alpha)$, then these two solutions are the only solutions.

Solution 2:

For another class of solutions, try $f(x) = -c x$ for $x \ge 0$, $-(2/c) x$ for $x < 0$, where $c > 0$ is constant. Still more generally, let $h(x) = x p(\log_2(x))$ for $x > 0$ where $p$ is continuous and periodic with period 1 and $p(t) + p'(t)/\ln(2) > 0$ everywhere. Thus $h$ is an increasing continuous function from $(0,\infty)$ onto itself, thus invertible on $(0,\infty)$. Let $f(x) = - h(x)$ for $x > 0$, $f(0) = 0$, $f(x) = 2 h^{-1}(-x)$ if $x < 0$.