Actually, there are lots of local solutions of this equation. For example, suppose that we start with a $C^2$ function $f$ on an interval $I\subset\mathbb{R}$ such that $f'$ is positive on $I$ and $f(I)$ is disjoint from $I$. Then an inverse $g:f(I)\to I$ of $f:I\to f(I)$ exists and is $C^2$. Now define $f$ on the interval $f(I)$ so that $f(y) = f''(g(y))$ for $y\in f(I)$. Then for $x\in I$, we will have $x = g(y)$ for some $y\in f(I)$ and, of course, $y = f(x)$. Then $f''(x) = f''(g(y)) = f(y) = f(f(x))$ for all $x\in I$.
Note 1: As an interesting aside, for every constant $a\in\mathbb{C}$, there is (unique) formal power series with lowest order term $az$ of the form $$ f(z) = az+\frac{{a}^{2}}{3!}\,{z}^{3} +{\frac {{a}^{3} \left( {a}^{2}{+}1 \right)}{5!}}\,{z}^{5} +{\frac {{a}^{4} \left( {a}^{6}{+}{a}^{4}{+}11\,{a}^{2}{+}1\right)}{7!}}\,{z}^{7}+\cdots $$ that satisfies $f''(z) = f(f(z))$. When $|a|<1$, this series converges absolutely and uniformly on the disk $|z|^2\le 6\bigl(1{-}|a|\bigr)$. (This is likely to be strictly less than the actual radius of convergence, as my method for proving convergence is not sharp. In fact, my method shows that $|f(z)|\le |z|$ when $|z|^2\le 6\bigl(1{-}|a|\bigr)$, but this is probably not sharp either.)
Though I don't (yet) have a proof, numerical calculations suggest that, when $a$ is a sufficiently small negative real number, the above function $f$ extends real analytically to the entire real line and gives a solution $f:\mathbb{R}\to\mathbb{R}$.