Possible Duplicate:
Square root of a function (in the sense of composition)
I'm interested in solving equations of the form $f(f(x))=g(x)$ for $x\in\mathbb{R}$ where $g(x)$ is a known function.
For example: if $g(x)=x$ then we $f(f(x))=x$ so one solution is $f(x)=x$, $\forall x\in\mathbb{R}$. However, another is
$f(x)=x+1$ if $x\in(0,1]$, $f(x)=x-1$ if $x\in(1,2]$ and $f(x)=x$ otherwise.
Hence there are infinitely many solutions to this equation when $g(x)=x$.
Problem: Find an $f$ where $f(f(x))=e^x$.
Extra: Are there extra constraints that could be placed on $f$ so the solution is unique?