Denote (∗) as the given condition. Replacing x=y=−21 in (∗), we get
f(2(f(−21))2−21)=0
If there exists some a=0 such that f(a)=0. Substituting x=a in (∗), we get f(y)=0 for any y, which is obviously a solution.
Let us consider now the case f(x)=0 for any nonzero real number x. Hence, f(0)=0 and f(−21)=±21. On the other hand, it is easy to see that if f is solution, then −f is also a solution. Therefore, we only need to consider the case f(0)=0 and f(−21)=−21. From this, we have
f(−21−f(y))f(21)=−f(y)−21,∀y∈R=21
and
f(x−f(x))=f(x)−x,∀x∈R
Therefore,
f(x−21−f(x))=f(−21−f(x−f(x)))=−21−f(x−f(x))=x−21−f(x)
which implies f(−f(21))=−f(21). Now, substituting x=21 and y=−f(21) in (∗), we get
f(21−2(f(21))2)=0.
Thus f(21)=±21. If f(21)=−21, then 21=−f(21)=f(−f(21))=f(21)=−21, contradiction. Therefore, f(21)=21.
From here, it follows that
f(f(y)+21)=f(y)+21,∀y∈R
In this equation, substituting y=x−21−f(x), we get
f(x−f(x))=x−f(x),∀x∈R
Comparing this result with f(x−f(x))=f(x)−x, we get f(x)=x for any x, which is clearly a solution.
In conclusion, there are three solutions: f(x)=0, f(x)=x and f(x)=−x for all real number x.