TITLE: Solving (quadratic) equations of iterated functions, such as $f(f(x))=f(x)+x$
QUESTION [15 upvotes]: In this thread, the question was to find a $f: \mathbb{R} \to \mathbb{R}$ such that
$$f(f(x)) = f(x) + x$$
(which was revealed in the comments to be solved by $f(x) = \varphi x$ where $\varphi$ is the golden ratio $\frac{1+\sqrt{5}}{2}$).

Having read about iterated functions shortly before though, I came up with this train of thought:
$$f(f(x)) = f(x) + x$$
$$\Leftrightarrow f^2 = f^1 + f^0$$
$$f^2 - f - f^0 = 0$$
where $f^n$ denotes the $n$'th iterate of $f$.
Now I solved the resulting quadratic equation much as I did with plain numbers
$$f = \frac{1}{2} \pm \sqrt{\frac{1}{4} + 1}$$
$$f = \frac{1 \pm \sqrt{1+4}}{2} = \frac{1 \pm \sqrt{5}}{2}\cdot f^0$$
And finally the solution
$$f(x) = \frac{1 \pm \sqrt{5}}{2} x .$$
Now my question is: *Is it somehow allowed to work with functions in that way?** I know that in the above, there are denotational ambiguities as $1$ is actually treated as $f^0 = id$ ... But since the result is correct, there seems to be some correct thing in this approach.
So can I actually solve certain functional equations like this? And if true, how would the correct notation of the above be?

REPLY [2 votes]: In fact this belongs to a functional equation of the form http://eqworld.ipmnet.ru/en/solutions/fe/fe1220.pdf.
Let $\begin{cases}x=u(t)\\f=u(t+1)\end{cases}$ ,
Then $u(t+2)=u(t+1)+u(t)$
$u(t+2)-u(t+1)-u(t)=0$
$u(t)=C_1(t)\left(\dfrac{1+\sqrt{5}}{2}\right)^t+C_2(t)\left(\dfrac{1-\sqrt{5}}{2}\right)^t$ , where $C_1(t)$ and $C_2(t)$ are arbitrary periodic functions with unit period
$\therefore\begin{cases}x=C_1(t)\left(\dfrac{1+\sqrt{5}}{2}\right)^t+C_2(t)\left(\dfrac{1-\sqrt{5}}{2}\right)^t\\f=C_1(t)\left(\dfrac{1+\sqrt{5}}{2}\right)^{t+1}+C_2(t)\left(\dfrac{1-\sqrt{5}}{2}\right)^{t+1}\end{cases}$ , where $C_1(t)$ and $C_2(t)$ are arbitrary periodic functions with unit period