Solution by Anonymous.
Let P(x,y) denote
f(f(x)+f(y)2)=x+y2.
From P(0,0), the function has a zero. Let c be such that f(c)=0. Then P(x,c) gives
f(f(x))=x+c2.
Hence f is bijective, and c is the unique zero of f.
Let a=f(0). Since P(0,0) gives f(a+a2)=0, uniqueness of the zero gives
c=a+a2.
On the other hand, substituting x=c into f(f(x))=x+c2 gives
a=f(0)=c+c2.
Combining these two relations, the only real possibility is c=0, and hence a=0.
Therefore f(f(x))=x. Replacing x by f(x) and y by f(y) in the original equation gives
f(x+y2)=f(x)+f(y)2.
Taking x=0 gives f(y2)=f(y)2, so
f(x+y2)=f(x)+f(y2).
Thus f is additive over all nonnegative increments. Taking x=−t with t≥0 gives f(−t)=−f(t), so this additivity extends to all real increments. Hence f is additive on R.
Finally, f(y2)=f(y)2≥0 for every y, so this additive function is nonnegative on the nonnegative reals. Therefore f(x)=kx for some k≥0. Since f(f(x))=x, we get k2=1, so k=1. Hence
f(x)=x for all x.
This function is checked directly to work.