Solve over the positive real numbers the functional equation
$$
f(x y+f(x))=x f(y)+2 .
$$
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.
Claim - $f$ is weakly increasing.

Proof. Assume for contradiction $a>b$ but $f(a)<f(b)$. Choose $y$ such that $a y+f(a)=$ $b y+f(b)$, that is $y=\frac{f(b)-f(a)}{a-b}$. Then $P(a, y)$ and $P(b, y)$ gives $a f(y)+2=b f(y)+2$, which is impossible.
Claim (Up to an error of 2, $f$ is linear) - We have
$$
|f(x)-(K x+C)| \leq 2
$$
where $K:=\frac{2}{f(1)}$ and $C:=f(f(1))-2$ are constants.
Proof. Note $P(1, y)$ gives $f(y+f(1))=f(y)+2$. Hence, $f(n f(1))=2(n-1)+f(f(1))$ for $n \geq 1$. Combined with weakly increasing, this gives
$$
2\left\lfloor\frac{x}{f(1)}\right\rfloor+C \leq f(x) \leq 2\left\lceil\frac{x}{f(1)}\right\rceil+C
$$
which implies the result.
Rewrite the previous claim to the simpler $f(x)=K x+O(1)$. Then for any $x$ and $y$, the above claim gives
$$
K(x y+K x+O(1))+O(1)=x f(y)+2
$$
which means that
$$
x \cdot\left(K y+K^{2}-f(y)\right)=O(1) .
$$

If we fix $y$ and consider large $x$, we see this can only happen if $K y+K^{2}-f(y)=0$, i.e. $f$ is linear.