Solution by skyvegetable666.
Let P(x,y) denote
f(x+f(y)2)=f(x)+f(y2)
for all real x and y.
Put a=f(0). From P(x,0),
f(x+a2)=f(x)+a.(1)
Taking x=−a2 gives f(−a2)=0. Hence P(0,−a2) gives f(a4)=0. Also, P(0,0) gives f(a2)=2a, so P(x,a2) gives
f(x+4a2)=f(x).
But applying (1) four times gives
f(x+4a2)=f(x)+4a.
Therefore a=0. Thus
f(0)=0,
and
f(f(y)2)=f(y2).(2)
Suppose first that f(y2)=0 for every y. Then f is zero on all nonnegative real numbers, and the original equation becomes
f(x+f(y)2)=f(x).
If f(y)=0 for some y, let
q=f(y)2>0.
Then
f(y+nq)=f(y)
for every positive integer n. For sufficiently large n, y+nq≥0, so f(y+nq)=0, a contradiction. Hence f is identically zero.
Now suppose f is not identically zero. Then there is some u such that
c=f(u2)=0.
Set
p=f(u)2.
By (2), f(p)=c, so p>0. From P(x,u),
f(x+p)=f(x)+c.(3)
We claim that f has no nonzero period. Suppose h=0 and
f(x+h)=f(x)
for every x. Set
t=2hp−h2.
Then
(t+h)2=t2+p.
Since f(t+h)=f(t), equation (2) gives
f((t+h)2)=f(f(t+h)2)=f(f(t)2)=f(t2).
However, (3) gives
f((t+h)2)=f(t2+p)=f(t2)+c,
contradicting c=0. Thus f has no nonzero period.
Comparing P(x,y) and P(x,−y), we see that
f(y)2−f(−y)2
is a period. Therefore
f(−y)2=f(y)2.(4)
By (3),
f(y+p)=f(y)+c,
and
f(−y−p)=f(−y)−c.
Applying (4) to y+p gives
(f(−y)−c)2=(f(y)+c)2.
Together with f(−y)2=f(y)2 and c=0, this gives
f(−y)=−f(y).(5)
For brevity, write h→r if
f(x+h)=f(x)+r
for every x. Direct substitution shows that h→r and k→s imply
h+k→r+s
and
h−k→r−s.
Moreover, if h→r and k→r, then h−k is a period. Since there is no nonzero period, h=k.
The original equation says
f(y)2→f(y2).(6)
In particular, p→c. Let
d=c2.
Since f(p)=c, equation (6) shows that d is also an allowable shift.
Let h→r, and set
z=2ph−p2.
Then
(z+p)2=z2+h.
By (6), the shift
f(z+p)2−f(z)2
has increment
f((z+p)2)−f(z2)=r.
It therefore has the same increment as h, so the absence of nonzero periods gives
h=f(z+p)2−f(z)2
=(f(z)+c)2−f(z)2
=2cf(z)+d.(7)
Consequently,
4d(h−d)2=f(z)2
is an allowable shift.
If v is an allowable shift, then d+v is also one. Applying the preceding result to d+v shows that
4dv2
is an allowable shift. Hence
2v=4d(d+v)2−4dd2−4dv2
is also an allowable shift. Starting with d, we conclude that every number
2nmd,
where m is an integer and n is a nonnegative integer, is an allowable shift. These numbers are dense in the real line.
Now let h→r and suppose x2+h≥0. Choose z such that
z2=x2+h.
By (6), the shift
f(z)2−f(x)2
has increment
f(z2)−f(x2)=f(x2+h)−f(x2)=r.
It has the same increment as h, so
f(z)2=f(x)2+h.(8)
If f(x)2<x2 for some x, density allows us to choose an allowable shift h satisfying
−x2<h<−f(x)2.
Then x2+h>0, while (8) gives
f(z)2<0,
which is impossible. Therefore
f(x)2≥x2(9)
for every real x.
Take h=d in (7). For
z=2pd−p2,
equation (7) gives f(z)=0. By (9), z=0, so d=p2. Since d=c2 and p>0,
c=εp
for some ε∈1,−1. Thus (3) becomes
f(x+p)=f(x)+εp.(10)
Define
g(x)=f(x)−εx.
Then
g(x+p)=g(x),
so
g(x+np)=g(x)
for every integer n. By (9),
0≤f(x+np)2−(x+np)2
=2εg(x)(x+np)+g(x)2.
If g(x)=0, the right-hand side is negative for sufficiently large positive or negative n, a contradiction. Hence g(x)=0 for every x, and therefore
f(x)=εx.
Direct substitution shows that both signs work. Hence all solutions are
f(x)=0,f(x)=x,f(x)=−x.