8. find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that for all real $x, y$ holds

$$
f(f(x)-f(y))=(x-y)^{2} f(x+y)
$$

## Solution
With $x=y$, $f(0)=0$ follows. With $x=0$ and $y=0$ respectively, you get the two equations $f(-f(y))=y^{2} f(y)$ and $f(f(x))=x^{2} f(x)$ and by combining them further

$$
f(f(x))=f(-f(x)) \quad \forall x \in \mathbb{R}
$$

Obviously, the zero function $f \equiv 0$ is a solution, so we assume in the following that $f(a) \neq 0$ applies for an $a \in \mathbb{R}$. With $y=a-x$ we then obtain

$$
f(f(x)-f(a-x))=(2 x-a)^{2} f(a)
$$

and here the right-hand side assumes all positive or all negative real values, depending on the sign of $f(a)$. The same applies to the left-hand side and therefore also to $f$. Together with (4), this shows in both cases that $f$ is an even function.

If you now replace $y$ with $-y$ in the original equation, the left-hand side does not change, and a comparison of the old and new right-hand sides produces the equation

$$
(x-y)^{2} f(x+y)=(x+y)^{2} f(x-y)
$$

If you finally set $y=x-1$, then $f(2 x-1)=(2 x-1)^{2} f(1)$ follows, so all solutions are of the form $f(x)=c x^{2}$ for a constant $c \neq 0$. Substitution shows $c= \pm 1$ and the three solutions are

$$
f(x)=0, \quad f(x)=x^{2}, \quad f(x)=-x^{2}
$$