Problem: Let $f \colon \RR \to \RR$ be a real-valued function
defined on the set of real numbers that satisfies
\[ f(x+y) \leq yf(x) + f(f(x))\]
for all real numbers $x$ and $y$.
Prove that $f(x) = 0$ for all $x \leq 0$.

Solution: We begin by rewriting the given as
\[ f(z) \le (z-x)f(x) + f(f(x)) \quad
  \forall x,z \in \RR \qquad (\heartsuit) \]
(which is better anyways since control over inputs to $f$ is more valuable).
We start by eliminating the double $f$:
let $z = f(w)$ to get
\[ f(f(w)) \le (f(w)-x)f(x) + f(f(x)) \]
and then use the \emph{symmetry trick} to write
\[ f(f(x)) \le (f(x)-w)f(w) + f(f(w)) \]
so that when we sum we get
\[ wf(w) + xf(x) \le 2f(x)f(w). \]

%(We remark now that if we set $w = 0$,
%we find that $xf(x) \le 2f(x)f(0)$ for all $x$;
%since we know $f(0)$ should be zero, this is pretty good.)

Next we use \emph{cancellation trick}: set $w = 2f(x)$ in the above to get
\[ xf(x) \le 0 \quad \forall x \in \RR. \qquad (\spadesuit) \]

\begin{claim*}
  For every $p \in \RR$, we have $f(p) \le 0$.
\end{claim*}
\begin{proof}
  Assume $f(p) > 0$ for some $p \in \RR$.
  Then for any negative number $z$,
  \[ 0 \overset{(\spadesuit)}{\le} f(z)
    \overset{(\heartsuit)}{\le} (z-p)f(p) + f(f(p)). \]
  which is false if we let $z \to -\infty$.
\end{proof}

Together with $(\spadesuit)$ we derive $f(x) = 0$ for $x < 0$.
Finally, letting $x$ and $z$ be any negative numbers
in $(\heartsuit)$, we get $f(0) \ge 0$, so $f(0) = 0$ too.
\begin{remark*}
  As another corollary of the claim, $f(f(x)) = 0$ for all $x$.
\end{remark*}
\begin{remark*}
  A nontrivial example of a working $f$ is to take
  \[ f(x) = \begin{cases}
      -\exp(\exp(\exp(x))) & x > 0 \\
      0 & x \le 0.
    \end{cases} \]
  or some other negative function growing rapidly in absolute value for $x > 0$.
\end{remark*}