Comparing x and −x, we get f(−x)2=f(x)2. Since f is injective, f(−x)=f(x) can happen only for x=0, so f is odd away from 0.
If f(u)=0, then P(u,0) and P(−u,0) imply f(−u)=0, and injectivity gives u=0. Hence f(0)=0, and f is odd on all of R.
Now
f(x2)=f(x)2,
so f(1)=1. From P(1,y) and P(−1,y),
f(f(y)+1)=y+1,f(f(y)−1)=y−1.
Thus
f(y+2)=f(y)+2.
Using P(2,x/2) and this shift by 4, we get f(f(x))=x for all x. Then P(1,f(x)) gives
f(x+1)=f(x)+1.
Finally, since f(x)2=f(x2), the original equation is
f(x2+f(xy))=f(x2)+xy.(1)
For a>0, choose x=a in (1) and vary y to get
f(a+f(t))=f(a)+t(a>0,t∈R).
For a=0 this is f(f(t))=t, and for a<0 it follows by oddness from the positive case. Therefore
f(a+f(t))=f(a)+t
for all real a,t. Replacing t by f(t) gives additivity:
f(a+t)=f(a)+f(t).
An additive function with f(x2)=f(x)2≥0 for all x is bounded below on every bounded interval of nonnegative inputs, hence is linear. Since f(1)=1, we get f(x)=x, which works.