Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ satisfying for all $x, y \in \mathbb{R}$ :

$$
f(y-f(x))=f(x)-2 x+f(f(y))
$$
The first good reflex is to see an $x$ on the right-hand side, which can show that $f$ is injective. Indeed, if we assume $f(x)=f\left(x^{\prime}\right)$ and write the functional equation for $x$ and $x^{\prime}$, we obtain by taking the difference that $2 x=2 x^{\prime}$, and thus $f$ is injective. We then set $x=0$ and $y=f(0)$, and we get $f(f(f(0)))=0$. By taking $x=f(f(0))$ and $y=0$ next, we get $f(f(0))=-2 f(f(0))$, so $f(f(0))=0$. Applying $f$ to both sides, we find $f(f(f(0)))=f(0)$, which finally gives $f(0)=0$ when combined with the previous result.

We return to the initial equation and set $x=0$. This gives us $f(y)=f(f(y))$, or $f(y)=y$ by injectivity. We verify conversely that the identity is indeed a solution to the equation.