Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that for all real numbers $x$ and $y$,

$$
f(f(x)+f(f(y)))=2 x+f(f(y))-f(f(x))
$$
Let $y=x$, the equation becomes $f(f(x)+f(f(x)))=2 x$ so $f$ is surjective. Knowing that $f$ is surjective, we can make the change of variable $z=f(y)$, where $z$ takes all values in $\mathbb{R}$. Again, we can make the change of variable $t=f(z)$ where $t$ takes all values in $\mathbb{R}$ (we secretly use the fact that if $f$ is surjective, $f \circ f$ is also a surjective function). The equation then becomes for $x=0, f(f(0)+t)=t-f(f(0))$, so $f$ is of the form $f: x \rightarrow x+c$ with $c=-f(0)-f(f(0))$ a constant.

$f(f(x)+f(f(y)))=x+y+4 c=2 x+f(f(y))-f(f(x))=x+y$ so $c=0$. We verify that the function $f: x \mapsto x$ is a solution to the equation.