Factorization of cubic $x^3 + x^2 - 2x -1\pmod p$ Show that $x^3 + x^2 - 2x -1$ factorizes mod $p$ as a product of distinct linear factors if $p \equiv \pm 1 \pmod 7$, is a cube for $p=7$ and irreducible otherwise.
I was told there are both a solution with splitting fields and an elementary solution but I can't think of any of them.
Any help appreciated!

To test whether $f$ has multiple roots, we perform the Euclidean algorithm for $\gcd(f,f')$. This gives
$$
7 = (2 x^2 + x - 3)(x^3 + x^2 - 2x -1)' +  (-6 x - 1)(x^3 + x^2 - 2x -1)
$$
Therefore, $x^3 + x^2 - 2x -1$ has a multiple root iff $p=7$.
Indeed, $x^3 + x^2 - 2x -1=(x+5)^3$. This also follows from the Euclidean algorithm. The first step tells us a double root, which in this case turns out to be a triple root:
$$
x^3 + x^2 - 2x -1=5(x+5)(x^3 + x^2 - 2x -1)' \bmod 7
$$

Here is a proof that if $x^3 + x^2 - 2x -1$ has a root, then it splits.
If $a$ is a root of $x^3 + x^2 - 2x -1$, then the other roots are $b= a^2 - 2$ and $c = -a^2 - a + 1$. This can also be expressed as follows: if $u$ is a root, then so is $g(u)=u^2-2$.
Indeed, the discriminant of $x^3 + x^2 - 2x -1$ is $\Delta=49$.
On the other hand, $\Delta=d^2$, where
$$d=(a-b)(a-c)(b-c)=(a-(b+c)a+bc)(b-c)=(3a^2+2a-2)(b-c)$$
since $b+c=-1-a$ and $bc=1/a=a^2+a-2$.
Therefore, $b-c=\dfrac{14 a^2 + 7 a - 21}{49}d$. Using $b+c=-1-a$ and $d=\pm 7$ gives the result.
