Solution by jasperE3.
f(xf(x)+f(y)2)=f(x)2+yf(y).
Claim: if f(f(k))=k for some k then f(k)2=k2.
P(k,x)⇒f(kf(k)+f(x)2)=f(k)2+xf(x).
P(f(k),x)⇒f(kf(k)+f(x)2)=k2+xf(x).
Comparing, we have the result.
Now note that:
f(f(xf(x)+f(y)2))=P(x,y)f(f(x)2+yf(y))=P(y,x)xf(x)+f(y)2,
so we have f(xf(x)+y2)2=(xf(x)+f(y)2)2. Expanding with P(x,y), this is:
(f(x)2+yf(y))2=(xf(x)+f(y)2)2.
Now
P(0,0)⇒f(f(0)2)=f(0)2 so we can plug in x=f(0)2, y=0 to the above equation to get f(0)8=(f(0)4+f(0)2)2 with only solution f(0)=0.
Now we can set just y=0, it implies that for all x, f(x)4=x2f(x)2 and so f(x)∈{0,−x,x}.
Suppose f(a)=−a and f(b)=b for some a,b=0.
P(a,b)⇒f(−a2+b2)=a2+b2.
If f(−a2+b2)=0 then a2+b2=0, impossible for a,b=0.
If f(−a2+b2)=−a2+b2 then 2a2=0, impossible for a=0.
If f(−a2+b2)=a2−b2 then 2b2=0, impossible for b=0.
So this scenario is impossible, and a and b cannot both exist at once.
If a exists, then f(x)=x for all x=0, so f(x)∈{0,−x} for all x. Let S={x∈R∣f(x)=−x}, then if a,b∈S we have:
P(b,a)⇒f(a2−b2)=−a2+b2, so a2−b2∈S.
Thus, our solutions are of the form:
Let {0}⊆S⊆R with the property that if a,b∈S then a2−b2∈S, then:
f(x)={−x0if x∈Sif x∈/S.
We can check that these are solutions by cases on x∈S and subcases on y∈S in P(x,y).
If b exists, then f(x)=−x for all x=0, so f(x)∈{0,x} for all x. Let S={x∈R∣f(x)=x}, then if a,b∈S we have:
P(a,b)⇒f(a2+b2)=a2+b2, so a2+b2∈S.
Thus, our solutions are of the form:
Let {0}⊆S⊆R with the property that if a,b∈S then a2+b2∈S, then:
f(x)={x0if x∈Sif x∈/S.
We can check that these are solutions by cases on x∈S and subcases on y∈S in P(x,y).