Solution by IcaRoNek0.
The solutions are
f(x)=cx(x∈R)
for arbitrary constants c∈R. These clearly work.
Assume f≡0. Choose u with f(u)=0, and put
t=f(u2),B=f(u)2>0.
Then
f(x+t)=f(x)+B,
so t=0. Comparing the original equation at y and −y gives f(−y)2=f(y)2. Therefore
(f(−y)+B)2=f(−y+t)2=f(y−t)2=(f(y)−B)2,
and hence f(−y)=−f(y). In particular, f(0)=0.
Let h=f∘f. Taking x=0 gives
h(y2)=f(y)2.
Thus h is odd and h(s)≥0 for s≥0. The equation extends, using oddness, to
f(x+f(z))=f(x)+h(z)(x,z∈R).
Set a=∣t∣>0. The translation formula gives
f(x+a)=f(x)+b
for some b=0; since f(0)=0, we have b=f(a). Hence
h(x+a)=f(f(x)+f(a))=h(x)+h(a).
Write d=h(a)≥0. For 0≤r<a, the inequalities h(r)≥0 and h(r−a)≤0 imply 0≤h(r)≤d. Therefore, writing s=na+r with n∈Z and 0≤r<a,
h(s)−ads≤d.
Now fix y. Since f(y+na)=f(y)+nb, applying the last bound to s=(y+na)2 gives
(f(y)+nb)2−ad(y+na)2≤d
for all positive integers n. The quadratic polynomial inside the absolute value is bounded as n→∞, so its quadratic and linear coefficients vanish:
b2=da,bf(y)=dy.
Thus f(y)=bdy=aby for every real y. Including f≡0, this gives exactly the stated family.