The two solutions are $f(x) = x$ and $f(x) = 0$. It easy to check that both of these work. Now we show that these are the only ones. Let $P(x,y)$ denote the functional equation.
Suppose that $f(c) = 0$ for $c\neq 0$. Then $P(c,x)$ implies
\[ c^2 f(x) = 0 \]so $f(x) = 0$ for all $x$.This gives the first solution. From now on we assume $f(c) \neq 0$ for all $c \neq 0$.
From $P(0,0)$ we get
\[ f(0) (f(-1) + 1) = 0 \implies f(-1) = -1 \text{ or } f(0) = 0 . \]Either way, we may conclude that $f(0) = 0$, since if $f(-1) = -1$, then taking $P(-1, 0)$ implies that $f(0) = 0$.
Now $P(1,1)$ gives
\[ f(1) f(f(1) - 1) = 0. \]By assumption, $f(1) \neq 1$, so $f(f(1) - 1) = 0$ so $f(1) = 1$. Then $P(1,x)$ gives that
\[ f(x-1) = f(x) - 1. \]Combining this with $P(x,1)$ gives
\[ f(x)f(f(x) - 1) = f(x)(f(x) -1) = x^2 - f(x) . \]Therefore $f(x) = \pm x$ for all real numbers $x$.
Suppose that there exists some nonzero $a$ such that $f(a) = -a$. Then $P(a,a)$ says that $a^3 = -a^3$ which is evidently impossible. Thus we conclude that $f(x) = x$ for all $x$.