Exercise 11. Find all functions $\mathrm{f}$ from $\mathbb{R}$ to $\mathbb{R}$ such that for every pair $(x, y)$ of real numbers:

$$
f(f(x))+f(f(y))=2 y+f(x-y)
$$
Solution to Exercise 11 Let's analyze the problem: here we are dealing with a functional equation with two variables. The first thing to do is to try some classic substitutions: $x=y=0$, $x=0, y=0, x=y$. Since we have a $f(x-y)$, it is very tempting to see what it gives for $x=y$. Let's set $C=f(0)$, for $x=y$, we get $2 f(f(x))=2 x+C$ which simplifies to $f(f(x))=x+\frac{C}{2}$.

Now that we have a more manageable expression for $f(f(x))$, we can substitute it back into the original equation and see what it gives.

By substituting back into the original equation, we have $x+y+C=2 y+f(x-y)$, which simplifies to $f(x-y)=x-y+C$. For $y=0$, we get $f(x)=x+C$ for all real $x$. Now, we need to determine $C$ before performing the verification, so we try to see what constraint the equation $f(f(x))=x+\frac{C}{2}$ imposes on $C$.

In particular, $f(f(x))=f(x+C)=x+2 C$, so $2 C=\frac{C}{2}$, which simplifies to $4 C=C$, and thus $3 C=0$, so $C=0$. Therefore, we have $f(x)=x$ for all real $x$. Now, we must not forget to verify that the function we found is indeed a solution! Conversely, the identity function works because in this case, $f(f(x))+f(f(y))=f(x)+f(y)=x+y=2 y+x-y=2 y+f(x-y)$ for all real $x, y$.

Comment from the graders: The exercise was very well done. Be careful not to conclude that $f$ is the identity when you find $f(X)=X$ with $X$ depending on $x$ and $y$ (you need to verify that $X$ can take all real values).