Find all functions $f: \mathbb{R} \rightarrow \mathbb{R}$ such that

$$
\forall x, y \in \mathbb{R}, f\left(x^{3}\right)-f\left(y^{3}\right)=\left(x^{2}+x y+y^{2}\right)(f(x)-f(y))
$$
We will look at two methods to solve this exercise. Let $x$ be a real number. We can first try to eliminate the $f\left(x^{3}\right)$. Thus, we subtract the equation with $y=1$ from the equation with $y=0$.

Thus we get $f(0)-f(1)=\left(x^{2}+x+1\right)(f(x)-f(1))-\left(x^{2}\right)(f(x)-f(0))$ and we want to isolate $f(x)$. Therefore,

$(x+1) f(x)=(x+1)((f(1)-f(0)) x+f(0))$.

Thus, if $x \neq-1$, then $f(x)=((f(1)-f(0)) x+f(0))$. Otherwise, we set $x=-1$ and $y=2$ to verify that this is also true for $f(-1)$. We verify conversely that affine functions are solutions.

We can also write the equation in the following form if $x \neq y: \frac{f\left(x^{3}\right)-f\left(y^{3}\right)}{x^{3}-y^{3}}=\frac{f(x)-f(y)}{x-y}$. Thus, if the slope of the graph of $f$ between $x$ and $y$ is the same as between $x^{3}$ and $y^{3}$. With $y=1$, $x \neq-1,0,1$, the points on the graph $(x, f(x)),(1, f(1))$ and $\left(x^{3}, f\left(x^{3}\right)\right)$ are aligned on a line $D$, and similarly $(x, f(x)),(0, f(0))$ and $\left(x^{3}, f\left(x^{3}\right)\right)$ are aligned on $D^{\prime}$. Since $x^{3} \neq x$, $D=D^{\prime}$, the points on the graph, except possibly $(-1, f(-1))$ (we handle this case separately), are aligned. Thus, the solutions are affine functions that fit.