TITLE: Is there a function such that $f(f(n)) = 2^n$?
QUESTION [10 upvotes]: In this question, I was looking for a specific "middle family" of functions between polynomials and "anti-polynomial exponentials", as I will call them, which are functions like like $2^{\sqrt{n}}$ that become exponential when chained to a polynomial (in the above case, $f(n^2) = 2^n$).
Now what I'm wondering is whether there exists a function that lies "exactly halfway" between linear and exponential in this way. Does there exist a continuous, monotone function $f: \mathbb{R}^+ \rightarrow \mathbb{R}^+$ such that $f(f(x)) = 2^x$ for all $x > 0$? Is there a closed form for it?

REPLY [2 votes]: It is possible to define such function piecewise, too. 
Assume that $f(0)=\frac{1}{2}$, then $f(1/2)=1$. 
Let $I_0=[0,1/2]$ and define $f$ over $I_0$ as $$f(x)=x+\frac{1}{2}.$$ Since $f(1)=\sqrt{2}$, we can take $I_1=[1/2,1]$ and define $f$ over $I_1$ as $$f(x)=2^{x-1/2},$$ then $f$ over $I_2=[1,\sqrt{2}]$ as $$f(x)=x\sqrt2,$$ $f$ over $I_3=[\sqrt{2},2]$ as $$f(x)=2^{x/\sqrt2},$$ $f$ over $I_4=[2,2^\sqrt2]$ as $$f(x)=x^\sqrt{2},$$ $f$ over $I_5=[2^\sqrt2,4]$ as $$f(x)=2^{x^{1/\sqrt2}},$$ $f$ over $I_6=[4,2^{2^\sqrt2}]$ as $$f(x)=2^{(\log_2 x)^{\sqrt2}},$$ $f$ over $I_7=[2^{2^\sqrt 2},16]$ as $$f(x)=2^{2^{(\log_2 x)^{1/\sqrt2}}},$$ $f$ over $I_8=[16,2^{2^{2^\sqrt2}}]$ as $$f(x)=2^{2^{(\log_2 \log_2 x)^{\sqrt2}}}$$ and so on. 
We have $I_{n+1}=[\max I_n,2^{\min I_n}]$ and given that $g_n$ is the inverse function of $f_{|I_n}$, $$f_{|I_{n+1}}=2^{g_n}.$$
Continuity and monotonicity are met.