Problem

Source: USAMO 2023/2

Tags: AMC, USA(J)MO, USAMO, functional equation



Let $\mathbb{R}^+$ be the set of positive real numbers. Find all functions $f \colon \mathbb{R}^+ \to \mathbb{R}^+$ such that, for all $x,y \in \mathbb{R}^+$, $$f(xy+f(x))=xf(y)+2.$$