Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that

$$
f(x+y)+y \leqslant f(f(f(x)))
$$

holds for all $x, y \in \mathbb{R}$.
Let $f: \mathbb{R} \rightarrow \mathbb{R}$ be a function satisfying the given inequality (2). Writing $z$ for $x+y$, we find that $f(z)+(z-x) \leqslant f(f(f(x)))$, or equivalently

$$
f(z)+z \leqslant f(f(f(x)))+x
$$

for all $x, z \in \mathbb{R}$. Substituting $z=f(f(x))$ yields $f(f(f(x)))+f(f(x)) \leqslant f(f(f(x)))+x$, from which we see that

$$
f(f(x)) \leqslant x
$$

for all $x \in \mathbb{R}$. Substituting $f(x)$ for $x$ we get $f(f(f(x))) \leqslant f(x)$, which combined with (3) gives $f(z)+z \leqslant f(f(f(x)))+x \leqslant f(x)+x$. So

$$
f(z)+z \leqslant f(x)+x
$$

for all $x, z \in \mathbb{R}$. By symmetry we see that we also have $f(x)+x \leqslant f(z)+z$, from which we conclude that in fact we even have

$$
f(z)+z=f(x)+x
$$

for all $x, z \in \mathbb{R}$. So $f(z)+z=f(0)+0$ for all $z \in \mathbb{R}$, and we conclude that $f(z)=c-z$ for some $c \in \mathbb{R}$.

Now we check whether all functions of this form satisfy the given inequality. Let $c \in \mathbb{R}$ be given and consider the function $f: \mathbb{R} \rightarrow \mathbb{R}$ defined by $f(z)=c-z$ for all $z \in \mathbb{R}$. Note that $f(f(z))=c-(c-z)=z$ for all $z \in \mathbb{R}$. For the lefthand side of (2) we find

$$
f(x+y)+y=(c-(x+y))+y=c-x
$$

while the righthand side reads

$$
f(f(f(x)))=f(x)=c-x .
$$

We see that inequality (2) holds; in fact we even have equality here.

We conclude that the solutions to (2) are given by the functions $f: \mathbb{R} \rightarrow \mathbb{R}$ defined by $f(z)=c-z$ for all $z \in \mathbb{R}$, where $c$ is an arbitrary real constant.