Solution:
It follows by
f(x2+y+f(y))=2y+(f(x))2
that the function f is surjective. Note also that (f(x))2=(f(−x))2. In particular, we may choose a such that f(a)=f(−a)=0. Setting x=0,y=±a in (1) gives 0=f(±a)=(f(0))2±2a, i.e., a=0. Plugging y=−2(f(x))2 in (1), we get that f(x2+y+f(y))=0 and therefore y+f(y)=−x2. Thus the function y+f(y) takes any non-positive value. Since f(0)=0, it follows from (1) that
f(x2)=((f(x))2≥0 and f(y+f(y))=2y
Setting z=x2,t=y+f(y), and using again (1) we deduce that f(z+t)=f(z)+f(t) for any z≥0≥t. For z=−t we get f(−t)=−f(t) and then it is easy to check that f(z+t)=f(z)+f(t) for any z and t. Since f(t)≥0 for t≥0, it follows that f is an increasing function. Suppose that f(y)>y for some y. Then f(f(y))≥f(y) and we get
2y=f(y+f(y))=f(y)+f(f(y))>2f(y)
a contradiction. Hence f(y)≤y. We see in the same way that f(y)≥y, so f(x)≡x. This function obviously satisfies (1).