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

$$
f(x+y)=x+f(f(y))
$$
- Let's test particular values: for $y=0$, we have $f(x)=x+f(f(0))$ so $f$ is of the form $f(x)=x+C$. It then suffices to substitute back into the initial equation: we have $f(x+y)=x+y+C=x+f(f(y))=x+y+2C$. In particular, for $x=y=0$, we have $C=0$ so $f$ is the identity function.

Reciprocally, the identity function works because $f(x+y)=x+y=x+f(y)=x+f(f(y))$

- Let's test particular values: for $x=0$ we get $f(y)=f(f(y))$. For $y=0$ we get $f(x)=x+f(f(0))$.

Let's show that $f$ is injective: if $f(a)=f(b)$ for $a$ and $b$ two rationals, we have $a+f(f(0))=b+f(f(0))$ so $a=b$.

In particular, since $f(f(y))=f(y)$ for all rational $y$, we deduce that $f(y)=y$ by injectivity.

Reciprocally, the identity function works because $f(x+y)=x+y=x+f(y)=x+f(f(y))$