> [!Question] Problem (BMO 1997, 2000)
> Find all functions $f:\mathbb{R}\to\mathbb{R}$ satisfying, for all $x,y\in \mathbb{R},$ the functional equation $f(xf(x)+f(y))=y+f(x)^{2}\tag{1}.$
###### Solution
Suppose $f(x)=f(y)$ for some real $x,y.$ Then $y+f(x)^{2}=f(xf(x)+f(x))=x+f(x)^{2}$ i.e. $x=y$ so $f$ is injective.
Plugging $x=0$ in $(1)$ gives $f(f(y))=y+f(0)^{2}.$ It follows that $f$ is surjective since the function on the right-hand side is surjective.
Since $f$ is surjective, there exists real $t$ such that $f(t)=0.$ Plugging $x=t$ in $(1)$ gives $f(f(y))=y$ for all real $y.$ Now plugging $x=f(x)$ in $(1)$ gives $f(xf(x)+f(y))=y+x^{2}.$ It follows that $f(x)^{2}=x^{2}$ i.e. $f(x)=\pm x.$ It remains to see if the sign of $f(x)$ depends on $x.$
Suppose there exists non-zero $x,y$ such that $f(x)=x$ and $f(y)=-y.$ Then $(1)$ gives $f(x^{2}-y)=y+x^{2}$ which yields $x^{2}-y=x^{2}+y$ or $y-x^{2}=x^{2}+y,$ which give $y=0$ or $x=0$ respectively - a contradiction. Hence the only solutions to $(1)$ are $f(x)=x$ and $f(x)=-x.$