I am asked to do the following:
Let $p$ be a prime number, suppose that $d|p-1$, investigate the number of solutions to the equations $$x^d\equiv 1 \mod p$$ and $$x^d\equiv 1 \mod p^2$$
There is also a hint to the second one: Consider $s+py$ where $s$ is a solution to the first equation, and $y\in\mathbb{Z}$.
Now I have already done the first one. Here's the sketch:
By Lagrange's Theorem, $x^d\equiv 1 \mod p$ has at most $d$ solutions.
Conversly, since $d|p-1$, let $e$ be such that $de=p-1$. Then $$x^{p-1}-1=x^{de}-1=(x^d-1)(x^{d(e-1)}+x^{d(e-2)}+...+x^{d}+1)$$ Since $p$ is prime, all solutions to $x^{p-1}-1 \equiv 0 \mod p$ must be a solution to either the congruence modulo $p$ equations of $x^d-1$ or $x^{d(e-1)}+...$ . By Fermat's Little Theorem, $x^{p-1}-1 \equiv 0 \mod p$ has exactly $p-1$ solutuons. And by Lagrange's Theorem, $$x^{d(e-1)}+x^{d(e-2)}+...+x^{d}+1\equiv 0 \mod p$$ has at most $d(e-1)=p-1-d$ solutions. It follows that $x^{d}-1 \equiv 0 \mod p$ has at least $p-1-(p-1-d)=d$ solutions.
So $x^d\equiv 1 \mod p$ has exactly $d$ solutions.
The second equation (the $p^2$ one) is where I am having trouble. The only thing I have spotted so far is that any solutions to the $p^2$ equation must also be a solution to the $p$ equation, so the $p^2$ equation can have at most $d$ solution again. I am not sure how to use the hint given either.
Thanks in advance!