Let $f:\mathbb{R}\to\mathbb{R}$ and for $x,y\in\mathbb{R}$ denote by $P(x,y)$ the assertion $f(xf(x)+f(y))=x^2+y$. Assume that $f$ satisfies $P(x,y)$ for all $x,y\in\mathbb{R}$. Then
$$
P(0,y):\quad f(f(y))=y\implies f\text{ bijective}\\
P(f(x),y):\quad f(f(x)f(f(x))+f(y))=f(x)^2+y\implies x^2+y=f(xf(x)+f(y))=f(f(x)f(f(x))+f(y))=f(x)^2+y\\
\implies f(x)^2=x^2
$$
We are no left to prove that either $f(x)=x$ for all $x$, or $f(x)=-x$ for all $x$, i.e. that $f$ doesn't jump around between $x\mapsto x$ and $x\mapsto -x$. For this, assume that there are $a,b\in\mathbb{R}\backslash\{0\}$ with $f(a)=a$ and $f(b)=-b$. Then
$$
P(a,b):\quad f(a^2-b)=a^2+b
$$
Now if $f(a^2-b)=a^2-b$ then $a^2-b=a^2+b$ and thus $b=0$, contradiction. But if $f(a^2-b)=-(a^2-b)$ then $-(a^2-b)=a^2+b$ and thus $a=0$, so again contradiction. Therefore, such $a,b$ don't exist, and thus either $f(x)=x\ \forall x$ or $f(x)=-x\ \forall x$, and one can verify easily that this are indeed solutions to the equation.
For all $x\in\mathbb{R}$ it now also follows that $$f(x(f(x))-f(x^{2}))=x^{2}-x^{2}=0\Leftrightarrow xf(x)=f(x^{2})$$
– Floris Claassens Apr 01 '19 at 12:14