Problem: Solve over the positive real numbers the functional equation
\[ f(xy+f(x)) = xf(y) + 2. \]

Solution: The answer is $f(x) \equiv x+1$,
which is easily verified to be the only linear solution.

We show conversely that $f$ is linear. Let $P(x,y)$ be the assertion.

\begin{claim*}
  $f$ is weakly increasing.
\end{claim*}
\begin{proof}
  Assume for contradiction $a>b$ but $f(a)<f(b)$.
  Choose $y$ such that $ay+f(a)=by+f(b)$, that is $y=\frac{f(b)-f(a)}{a-b}$.
  Then $P(a,y)$ and $P(b,y)$ gives $af(y)+2=bf(y)+2$, which is impossible.
\end{proof}

\begin{claim*}
  [Up to an error of $2$, $f$ is linear]
  We have
  \[ \left\lvert f(x) - (K x + C) \right\rvert \le 2 \]
  where $K \coloneq \frac{2}{f(1)}$ and $C \coloneq f(2f(1))-2$ are constants.
\end{claim*}
\begin{proof}
  Note $P(1,y)$ gives $\boxed{f(y+f(1)) = f(y)+2}$.
  Hence, $f(nf(1)) = 2(n-1)+f(f(1))$ for $n \ge 1$.
  Combined with weakly increasing, this gives
  \[ 2\left\lfloor \frac{x}{f(1)} \right\rfloor + C
    \le f(x) \le 2\left\lceil \frac{x}{f(1)} \right\rceil + C \]
  which implies the result.
\end{proof}

However, we will only need to remember from the earlier claim that
\[ f(x) = Kx+O(1). \]
Then for any $x$ and $y$, the above claim gives
\[ K\left( xy + Kx + O(1) \right) + O(1) = x f(y) + 2 \]
which means that
\[ x \cdot \left( Ky + K^2 - f(y) \right) = O(1). \]
If we fix $y$ and consider large $x$,
we see this can only happen if $Ky+K^2-f(y)=0$, i.e.\ $f$ is linear.