TITLE: Solving functional equation $f(x)^2+f(y)^2=f(x+y)(f(f(x))+f(y))$
QUESTION [19 upvotes]: I was trying to find  functions $f:(0,+\infty)\to(0,+\infty)$ satisfying the following functional equation
$$
f(x)^2+f(y)^2=f(x+y)(f(f(x))+f(y))
$$
The problem is that I can't find here any reasonable substitution. The only thing I've concluded is the following
$$
f(f(x))-f(x)=\mathrm{const}
$$
It follows from the fact that lhs is invariant under transform $(x,y)\to(y,x)$. So how could I procced from here, or may be this is a wrong way?

REPLY [3 votes]: Here's a proof that the only continuous solutions are constant. Suppose $f(x)$ were a nonconstant continuous solution; we will derive a contradiction. Since $f(x)$ is nonconstant and continuous, the range of $f(x)$ contains an interval $(a,b)$. As suggested by Norbert in the original question, we can take advantage of the $(x,y) \to (y,x)$ symmetry and we have two equations
$$
f(x)^2+f(y)^2=f(x+y)(f(f(x))+f(y))
$$
$$
f(x)^2+f(y)^2=f(x+y)(f(f(y))+f(x))
$$
Hence we have
$$f(f(x))+f(y) = f(f(y)) + f(x)$$
In particular, if $f(x) \neq f(y)$ are in $(a,b)$, we have
$$\frac{f(f(y)) - f(f(x))}{f(y) - f(x)} = 1$$
Since $(a,b) \subset $ range$(f)$, we may take the limit of the above as $f(y)$ approaches $f(x)$, and get that
$$f'(f(x)) = 1$$
This is true for any $f(x) \in (a,b)$, so we have that $f'(y) = 1$ for all $y \in (a,b)$. Hence there is a constant $c$ such that $f(y) = y + c$ on $(a,b)$.
As Norbert also pointed out in his original question, there is also a constant $a$ such that we have
$$f(x)^2+f(y)^2=f(x+y)(f(y)+f(x) + a)$$
So for $x,y \in (a,b)$ we have
$$(x + c)^2 + (y + c)^2 = f(x + y)(x + y + 2c + a)$$
In particular, this is true for $x,y \in (a,b)$ with $x + y = a + b$, for which we have
$$(x + c)^2 + (a + b - x + c)^2 = f(a + b)( a + b + 2c + a)$$
However, the left-hand side of the above is not a constant function of $x$, and the right-hand side is. This gives a contradiction and we are done.
Note that this shows that any solution whose range contains an interval is constant. So if any nonconstant $f(x)$ solves this, it will be a rather weird function.