Solution by jasperE3.
f(xf(x)+f(x)f(y))=f(x2)+xy.
If f(a)=f(b):
f(1)+a=P(1,a)f(f(1)+f(1)f(a))=f(f(1)+f(1)f(b))=P(1,b)f(1)+b,
so a=b, that is, f is injective.
P(−f(0),0)⇒f(f(0)2)=f(0)⇒f(0)2=0⇒f(0)=0.
P(x,0)⇒f(xf(x))=f(x2)⇒xf(x)=x2, so f(x)=x for all x=0. Combined with f(0)=0 this implies f(x)=x for all x.