A difficult functional equation Is it possible to solve the following functional equation-
Determine all functions $f: \mathcal{R} \rightarrow \mathcal{R}$ such that $f(f(x)-f(y))=f(f(x))-2x^2f(y)+f(y^2)$ for all reals $x,y$
Here , $\mathcal{R}$ denotes the set of all reals.

I suppose that $f$ is not $0$. 
1) I put first $a=f(0)$. Then $x=y=0$ gives $f(a)=0$. Putting $y=a$ gives $f(a^2)=0$, and replacing $x$ by $a$ gives $$f(-f(y))=a-2a^2f(y)+f(y^2)$$  
2) Let $b$ such that $f(b)=0$. Replacing $x$ by $b$ gives 
$$f(-f(y))=a-2b^2f(y)+f(y^2)$$. By the above, this is true $b=a^2$. If $a^4\not =a^2$, then the two relations gives $f=0$. Hence we must have $a=0$ or $a=\pm 1$.
3) I suppose now that $a=f(0)=0$. We have hence $$f(-f(y))=f(y^2)\quad (1)$$ In addition, if $f(b)=0$, we must have $b=0$. If we put $x=y$, we get
$$f(f(x)=2x^2f(x)-f(x^2)\quad (2)$$ 
a) Let $x,y$ not zero, and suppose that $f(x)=f(y)$. Then we get that $f(x^2)=f(-f(x))=f(-f(y))=f(y^2)$, and $f(f(x))=f(f(y))$. Hence by (2), we have $f(x)(y^2-x^2)=0$. As $f(x)\not =0$, we find $y=\pm x$. 
b) From (1), we get that $f(y)=\pm y^2$ for all $y$.
Suppose that $f(x)=-x^2$ By using (2), we get that $f(x^2)+f(-x^2)=-2x^4$. But as $f(\pm x^2)=\pm x^4$, we get that $f(x^2)=f(-x^2)=-x^4$. 
Now if $f(y)=y^2$, by using (2) again, we show that $f(y^2)=y^4$. 
c) Now suppose that there exists $x,y$, not zero, with $f(x)=-x^2$ and $f(y)=+y^2$. The original equation show that 
$$f(-x^2-y^2)=-x^4-2x^2y^2+y^4$$
But we must have $f(-x^2-y^2)=\pm (x^2+y^2)^2$, and it is easy to see that this is not the case.
d) Hence we must have $f(x)=-x²$ for all $x\not =0$, (hence for all $x$) or $f(x)=x^2$ for all $x$. It is easy to see that they both are solutions.
4) Now if $a=f(0)=\pm 1$, I think that we can follow the same way, If $f(0)=1$, then $f(1)=0$, if $f(b)=0$, then $b=\pm 1$ in the same way, etc. 
I must say that I have not completed the computations. If I am not wrong, this leads to two other solutions, namely $f(x)=1-x^2$ and $f(x)=-1+x^2$. 
