Solution by OronSH.
We claim that the solutions are
f(x)≡0orf(x)=x.
Both are easy to check. From P(0,y),
f(f(0))=f(0)2+yf(0),
so f(0)=0.
Now P(−1,1) gives
f(−1)2+f(−1)=0,
so f(−1)=0 or f(−1)=−1.
If f(−1)=0, then P(−1,−y) gives f(f(y))=0 for all y. Applying f to both sides of the original equation gives
f(f(x)2+yf(x))=0.
If some f(x)=0, then the argument f(x)2+yf(x) spans all real numbers as y varies, forcing f≡0, a contradiction to f(x)=0. Hence f≡0.
Now assume f(−1)=−1. Then P(−1,−y) gives
f(1+f(y))=1+y,
so f is bijective. Taking y=−2 and y=−3 in this relation gives
f(−2)=−2,f(−3)=−3.
Using P(−2,−y/2) and comparing with f(1+f(y+3))=y+4 gives
f(y+3)=f(y)+3.
Similarly, P(−3,−y/3) gives
f(y+8)=f(y)+8.
Therefore
f(y+1)=f(y+9−8)=f(y)+1.
Comparing P(x+1,0) with P(x,2), and using this shift identity, gives
f(2x)=f(x)+x.
Comparing P(x+2,0) with P(x,4) similarly gives
f(4x)=2f(x)+2x.
But the previous relation also gives
f(4x)=f(2x)+2x=f(x)+3x.
Thus f(x)=x for every x.