$d\mid p\!-\!1\Rightarrow x^d-1\pmod{\!p^2}$ has exactly $d$ roots for odd prime $p$ I'm trying to figure out the number of solutions to the congruence equation $x^d \equiv1 \pmod{p^2}$ where $p$ is prime and $d\mid p-1$.
For the congruence equation ${x^d}\equiv1 \pmod p$ where $p$ is prime and $d\mid p-1$ I've shown that there are exactly $d$ solutions modulo $p$.
I'm trying to use the above result to extend it to the higher power. I'm aware of something called Hensel's Lemma which says if a polynomial has a simple root modulo a prime  $p$, then this root corresponds to a unique root of the same equation modulo any higher power of $p$. We can 'lift' the root iteratively up to higher powers.
I'm unsure exactly how this process works. All I have to start with is that I assume a solution of the form $m+np$ solves the 'base' congruence and I'm trying to somehow extend it to $p^2$.
Any help would be appreciated.
Thanks.

Let $p$ be an odd prime, and work modulo $p^k$ (so $k$ does not have to be $2$). Then if $d$ divides $p-1$, the congruence $x^d\equiv 1\pmod{p^k}$ has exactly $d$ solutions. 
To prove this, we use the fact that there is a primitive root $g$ of $p^k$, that is, a generator of the group of invertibles modulo $p^k$. Then for $1\le n\le (p-1)p^{k-1}$, we have $(g^n)^d\equiv 1\pmod{p^k}$ if and only if $nd$ is a multiple of $(p-1)p^{k-1}$. There are $d$ different such $n$, namely $i\frac{p-1}{d}p^{k-1}$ for $i=1,2,\dots, d$. 
