The function f is either f(x)=0 or f(x)=x3+c with an arbitrary c∈R.
Proof: Obviously f(x)=0 is a solution, so let us assume that a real number a=0 belongs to the range of f. Let us first assume a>0. Taking x=−f(y) in the given equation we get
f(−f(y))=f(0)−f(y)3=(−f(y))3+c,c=f(0).(1)
The function
g(x)=f(x+a)−f(x)=(x+a)3−x3=3a(x+2a)2+4a3
takes every value z≥a3/4. For every such z=g(x), equation (1) then gives
f(z)=f(g(x))=f(−f(x)+f(x+a))=f(−f(x))+(−f(x)+f(x+a))3−(−f(x))3=g(x)3+c=z3+c.(2)
Thus f takes every value not less than (a3/4)3+c, which implies that f is unlimited from above. For every x we can then choose a y such that x+f(y)≥a3/4 so that from (2) we get
f(x)=f(x+f(y))−(x+f(y))3+x3=x3+c.
This function evidently satisfies the given equation for an arbitrary c∈R.
If a<0, we can set f(x)=−h(−x). It is easily verified that if f satisfies the given equation, so does h. Furthermore h takes the value −a>0, so h is given by h(x)=x3+c for some c∈R. Hence we get f(x)=x3−c. Since these functions form the same class as those which were found above, this completes the proof.