Let P(x,y) be the assertion f(xf(x)+f(y)2)=xf(x)+y2.
We claim that the solutions are of the form:
f(x)={−xxif x∈Sif x∈/S
where c∈(0,1) is any constant and S⊆[−c,−c2) or S⊆(−c,−c2] any set. This includes the particular solution f(x)=x when S=∅.
To show that these satisfy the equation, note first that f(x)2=x2 for all x, so it remains to show that:
f(xf(x)+y2)=xf(x)+y2.
If S⊆[−c,−c2) then xf(x)≥−c2 for all x whether x∈S or x∈/S. This translates to xf(x)+y2≥−c2 and therefore xf(x)+y2∈/S so the equation is satisfied.
If S⊆(−c,−c2] then xf(x)>−c2 for all x whether x∈S or x∈/S. This translates to xf(x)+y2>−c2 and therefore xf(x)+y2∈/S so the equation is satisfied.
Claim 1:f(0)=0, f(1)=1.
P(0,x)⇒f(f(x)2)=x2, so:
f(x4)=f(f(f(x)2)2)=f(x)4.
With x=0 and x=1 we have {f(0),f(1)}⊆{0,1}.
If f(0)=f(1) then:
P(x,0)⇒f(xf(x)+f(0)2)=xf(x).
P(x,1)⇒f(xf(x)+f(0)2)=xf(x)+1, contradiction. Now suppose f(0)=1 and f(1)=0, a contradiction suffices to prove the claim.
P(x,0)⇒f(xf(x)+1)=xf(x).
P(0,xf(x)+1)⇒f(x2f(x)2)=x2f(x)2+2xf(x)+1.
P(f(x)2,1)⇒f(x2f(x)2)=x2f(x)2+1.
Comparing the last two, we obtain f(x)=0 for all x=0, but this gives a contradiction upon P(0,2)⇒f(f(2)2)=4.
Claim 2:f(x)>x−1 for all x≥0.
First, from f(x4)=f(x)4 we have f(x)≥0 for all x≥0, and in particular f(x)>x−1 for all 0≤x<1.
Now:
P(1,f(x)2)⇒f(x4+1)=f(x)4+1=f(x4)+1, so f(x+1)=f(x)+1 for all x≥0. By induction, f(x+n)=f(x)+n for all x≥0 and n∈N, so we can extend f(x)>x−1 for all 0≤x<1 to all x≥0.
P(0,x)⇒f(x)2≤f(f(x)2)=x2, and since f(x)≥0 for all x≥0 we can take the square root to get the result.
Combining Claims 3 and 4, f(x)=x for all x≥0.
Claim 5:f(x)=x for all x≤−1.
P(0,x)⇒f(x)2=x2, so P(x,y) becomes f(xf(x)+y2)=xf(x)+y2.
Suppose f(u)=−u for some u≤−1, then u2+u≥0 so:
P(u,u2+u)⇒f(u)=u, so u=0 contradicting u≤−1.
Now we have to figure out what happens to f(x) for x∈(−1,0). Let S={x∈(−1,0)∣f(x)=−x} and c=x∈(−1,0)supf(x). Note two properties: first, that f(x)=x⇔x∈/S, and secondly that c is finite, since ∣f(x)∣=∣x∣<1 for all x∈(−1,0) implies c≤1. If c≤0 then f(x)=x for all x∈(−1,0), leading to f(x)=x, part of the aforementioned solution set with S=∅. So we may assume that c∈(0,1].
Claim 6:S⊆[−c,−c2].
Note that c=x∈Ssup(−x)=−infS, so S⊆[−c,0).
Suppose −c2<u<0 with u∈S. Then, since c2>−u, there is some v∈S with v2>−u. But then:
P(v,u+v2)⇒f(u)=u, contradicting u∈S.
The claim is proven. Now if −c∈S then P(−c,0)⇒f(−c2)=−c2⇒−c2∈/S, so at least one of −c and −c2 must be absent from S.
Suppose c=1, then S⊆{−1}. If −1∈S then it would imply that both −c and −c2 are in S, this is impossible so we must have S=∅, however this contradicts c=1 (since we would have f(x)=x for all x).
Therefore, c=1, so the solution set we provided is complete.