Find $f(x)$ for $f(f(x))=\sin x$ Find all (if that's possible) functions $f:\mathbb{R}\rightarrow\mathbb{R}$ such that $$f(f(x))=\sin x.$$
This is a problem a friend gave me. He said he saw it on a book a long time ago, but he couldn't remember what book. I literally have no idea how to solve this so I can't post my attempt here.
 A: I think there is an analytic solution. 
Let $f(z) = \sum_{n=1}^\infty c_n z^n$ be analytic for $|z|$ small enough. We have
$$f(f(z)) = \sum_{n=1}^\infty c_n f(z)^n =\sum_{n=1}^\infty c_n (\sum_{k=1}^\infty c_k z^k)^n$$
$$ = \sum_{n=1}^\infty c_n \sum_{m=1}^\infty z^m \sum_{\sum_{l=1}^n k_l = m} \prod_{l=1}^n c_{k_l}$$
$$ = \sum_{m=1}^\infty z^m  \sum_{n=1}^m c_n\sum_{\sum_{l=1}^n k_l = m} \prod_{l=1}^n c_{k_l}$$
And if we are given an analytic function $g(z) = \sum_{m=1}^\infty b_m z^m$, the equation $g(z) = f(f(z))$ for $|z|$ small enough becomes
$$b_m = \sum_{n=1}^m c_n\sum_{\sum_{l=1}^n k_l = m} \prod_{l=1}^n c_{k_l}$$
$$ = c_1 c_m + c_m c_1^m + \underbrace{\sum_{n=2}^{m-1} c_n\sum_{\sum_{l=1}^n k_l = m}\prod_{l=1}^n c_{k_l}}_{\text{only } c_k, \  k < m \text{ appears there}} $$
so that a solution for the coefficients always exist when $b_1 = 1$ :
$$c_1 = 1, \qquad c_m = \frac{1}{2}(b_m - \sum_{n=2}^{m-1} c_n\sum_{\sum_{l=1}^n k_l = m}\prod_{l=1}^n c_{k_l})$$
All we have to do then is proving $f(z) = \sum_{n=1}^\infty c_n z^n$ converges : that $c_n = \mathcal{O}(R^n)$ for some $R$.
A: There are uncountably many solutions. Let $\sigma$ be any involution of $I_0=(1,\pi/2]$ without fixed points. For example, we could take
$$
  \sigma(x)=\begin{cases}
    ax+\frac{\pi/2-a^2}{a+1}&\text{if }1<a\leq\frac{a+\pi/2}{a+1},\\
    x/a+\frac{a-\pi/(2a)}{a+1}&\text{if }\frac{a+\pi/2}{a+1}<a\leq\pi/2
  \end{cases}
$$
for any $a>0$. Let $I_n=\sin(I_{n-1})$ for $n>1$. Note that
$$
  (0,\pi/2]=\bigsqcup_{n\geq 0}I_n.
$$
Now define $f$ according to the following rules:
$$\begin{eqnarray*}
  f(0)&=&0,\\
  f(x)&=&\sigma(x)\text{ if }x\in I_0\text{ and }x>\sigma(x),\\
  f(x)&=&\sin(\sigma(x))\text{ if }x\in I_0\text{ and }x<\sigma(x),\\
  f(x)&=&\sin(f(\sin^{-1}(x)))\text{ if }x\in I_n,\,n>0,\\
  f(x)&=&-f(-x)\text{ if }x\in[-\pi/2,0),\\
  f(x)&=&f(\pi-x)\text{ if }x\in(\pi/2,3\pi/2],\\
  f(x)&=&f(x-2\pi)\text{ if }x>3\pi/2,\\
  f(x)&=&f(x+2\pi)\text{ if }x<-\pi/2.
\end{eqnarray*}$$
Note that exactly one rule applies to each $x\in\mathbb R$. Also the rule for $x\in I_n$ implies $f(\sin x)=\sin f(x)$ for $x\in(0,\pi/2]$. We can verify $f(f(x))=\sin x$ by considering each possibility for $x$. If $x\in I_0$ and $x>\sigma(x)$ then $\sigma(\sigma(x))=x>\sigma(x)$, so
$$
  f(f(x))=f(\sigma(x))=\sin(\sigma(\sigma(x))=\sin x.
$$
If $x\in I_0$ and $x<\sigma(x)$ then
$$
  f(f(x))=f(\sin(\sigma(x))=\sin f(\sigma(x))=\sin x.
$$
If $x\in I_n$ and the statement holds on $I_{n-1}$ then
$$
  f(f(x))=f(\sin(f(\sin^{-1}(x))))=\sin(f(f(\sin^{-1}(x))))=\sin x.
$$
If $x\in[-\pi/2,0)$ then
$$
  f(f(x))=f(-f(-x))=-f(f(-x))=-\sin(-x)=\sin x.
$$
Thus $f(f(x))=x$ for $x\in[-\pi/2,\pi/2]$, and the remaining rules extend this to $x\in\mathbb R$.
A: There have been a couple of questions about this function at MSE and Math Overflow, perhaps the best discussion related to your question is at MO which includes a solution via the technique of finding the Abel-function introduced by J.Ecalle.               
I've looked -more naively- at the formal power series up to the 512'th term finding strong divergence here or here so concluding the radius of convergence of the power series being zero (but the series usable as asymptotic series giving usable approximations at truncations of the series, or being Noerlund-summable in the sense of summation-procedures for divergent series)
A picture of $y=\sin(x)$, the half-iterate $y=\sin^{\circ 0.5}(x)$ , $y=\sin^{\circ 1/3}(x)$ and $y=x$ (using the asymptotic powerseries of Ecalle's Abel-solution as shown in that thread at MO)                

A: Now, given a specific $x$ with $x_1 = \sin x$ and $ x_{n+1} = \sin x_n$ it is a result of Jean Ecalle at Orsay that we may take
$$ \alpha(x) = \lim_{n \rightarrow \infty} \; \; \; \frac{3}{x_n^2}  \; + \; \frac{6 \log x_n}{5}  \; + \; \frac{79  x_n^2}{1050}   \; + \; \frac{29  x_n^4}{2625}  \; - \; n.$$
Note that $\alpha$ actually is defined on  $ 0 < x < \pi$ with
$\alpha(\pi - x) = \alpha(x),$ but the symmetry also means that the inverse function returns to the interval  $ 0 < x \leq \frac{\pi}{2}.$ You can see how this cannot be extended around the origin as a meromorphic function because of the evident logarithm term.
Before going on, the limit technique in the previous paragraph is given in pages 346-353 of Iterative Functional Equations
by Marek Kuczma, Bogdan Choczewski, and Roman Ger. The solution is specifically Theorem 8.5.8 of subsection 8.5D, bottom of page 351 to top of page 353. Subsection 8.5A, pages 346-347, about Julia's equation, is part of the development.
We define ( at least for $ 0 < x \leq \frac{\pi}{2}$) 
$$ f(x)  = \alpha^{-1} \left( \frac{1}{2} + \alpha(x)   \right) $$
That's the short version. In Milnor's book, $\alpha$ is called a Fatou coordinate.
