If $r$ is a primitive root of $p$ and $p^2$, then show that it is also a primitive root of $p^3$
This is part of a bigger proof and I'm stuck at understanding this part.
Here some lines of proof from my textbook:
$r^{p-1}\equiv 1 \pmod{p}$
$r^{p-1}\not\equiv 1 \pmod{p^2}$
By Euler,
$r^{\phi(p^2)} = r^{p(p-1)}\equiv 1\pmod{p^2}$
$\Rightarrow r^{p(p-1)} = 1 + ap^2$ for some integer $a$.
Then my textbook simply claims $p\nmid a$ by hypothesis.
I don't get this. Why can't $p$ divide $a$ ? How does it follow from hypothesis?