Solution by jasperE3.
We claim the only solutions are f(x)≡x, f(x)≡−x, f(x)≡−x+1, f(x)≡x−1, and f(x)≡0, which obviously work. We now show they are the only solutions. Let P(x,y) denote the assertion that f(x2+f(x)f(y))=xf(x)+yf(x).
Case 1: f(0)=0
f(x)=0 is a solution, else there is some j with f(j)=0.
P(x,0)⇒f(x2)=xf(x)⇒f is odd.
If f(k)=0:
P(j,k)⇒kf(j)=0⇒k=0.
P(x,−x)⇒f(x2−f(x)2)=f(x2+f(x)f(−x))=0⇒x2−f(x)2=0⇒f(x)∈{−x,x} for each x.
Suppose f(a)=−a and f(b)=b for some 0=a=b=0:
P(a,b)⇒f(a2−ab)=a2+ab⇒a2+ab∈{a2−ab,ab−b2}.
In the first case we have ab=0, a contradiction, and in the second case we have a=−b. However since f is odd this implies −a=f(a)=−f(b)=−b so a=b, contradiction.
Hence either f(x)=x or f(x)=−x in this case, which both fit.
Case 2: c=f(0)=0
P(0,x)⇒f(cf(x))=cx⇒f is bijective.
Suppose f(x+a)=f(x)+b for some constants a and b=0 and all x.
For x=cf(0)=f−1(0) we have:
P(x,y+a)⇒f(x2+f(x)f(y)+bf(x))=f(x2+f(x)f(y))+af(x).
Now use f−1(f(x)y−x2) instead of y to cancel some terms, we get f(y+bf(x))=f(y)+af(x). Now f(x) can take any value except 0, so f(y+bx)=f(y)+ax, setting y=0 we have f(x)=bax+c whether x=0 or x=0, testing linear solutions in the functional equation we get f(x)=−x+1 and f(x)=x−1.
Otherwise let’s assume that such an a and b cannot exist.
Bring up any x=cf(0), and let g(x)=f−1(f(x)1) so that f(x)f(g(x))=1.
P(x,y2+f(y)f(z))⇒f(x2+(y+z)f(x)f(y))=xf(x)+y2f(x)+f(x)f(y)f(z).
Set y=g(x) and we get:
f(x2+g(x)+z)=xf(x)+g(x)2f(x)+f(z),
which contradicts our statement above if xf(x)+g(x)2f(x)=0. Otherwise, we have to have xf(x)+g(x)2f(x)=0 for all such x, which means x=−g(x)2≤0 for all x=cf(0), contradiction. No further solutions.