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

$$
f(f(x)+2 y)=6 x+f(f(y)-x)
$$
Keys: injectivity/surjectivity, "injective or periodic" alternative

By setting $y=-f(x) / 2$, we have $f(f(y)-x)=f(0)-6 x$. The right-hand side describes all of $\mathbb{R}$ as $x$ does the same, so $f$ is surjective. In many functional equations, it is such a "outer" surjective function (here $x \rightarrow f(0)-6 x$) that allows us to show that $f$ is surjective.

If there exist $a>b$ such that $f(a)=f(b)$, then by writing the equation successively with $y=a$ and $y=b, f(f(x)+2 a)=f(f(x)+2 b)$ for all $x$, so by the surjectivity of $f, f(z)=f(z+2 a-2 b)$ for all real $z$, so $f$ is $2(a-b)$ periodic.

Let's use the non-periodicity of the function $x \mapsto 6 x$ to show that this is absurd: by writing the equation twice with $x=0$ (for example) and $x=2(a-b)$, we get $2(a-b)=0$.

Therefore, $f$ is injective. By taking $x=0$ in the equation, we get $f(y)=2 y+f(0)$ for all real $y$. It only remains to find the possible values for $f(0)$ such that $f$ is indeed a solution: the initial equation becomes

$$
2(2 x+f(0)+2 y)+f(0)=6 x+2(2 y+f(0)-x)+f(0)
$$

and this is true for all $x, y, f(0) \in \mathbb{R}$.

## Remark 1.3.1.

The "injective or periodic" alternative can appear when there are terms like $f(x+f(y))$: in the argument of $f$, we have a function of $x$ plus a function of $y$. In the example above, it is the outer function $x \mapsto 6 x$ that "decided" the injective nature of $f$. In a completely different context, when a sequence $\left(u_{n}\right)$ is such that each term is expressed as a certain function $g$ of the previous one, then the sequence is either injective or periodic, because if $u_{n}=u_{k}$ for some $n \neq k, u_{n+1}=u_{k+1}$, etc.