TITLE: question about primitive roots modulo p
QUESTION [6 upvotes]: I know that every group of units $\bmod p$ has a generator, in fact $\varphi(p-1)$ of them. 
I came across a problem that asked to prove that for such a generator, let's call it $a$ (but see below), and $p$ an odd prime:
$$a^{p-1} = 1 + kp$$
where $\gcd(k,p) = 1$
It's the last part that is killing me. I can see that $p$ divides $a^{(p-1)/2} + 1$, since it cannot divide $a^{(p-1)/2} - 1$ (this would contradict that $a$ is a generator), but I have no idea how to show that $p^2$ does not divide $a^{(p-1)/2} + 1$.
Any ideas?
EDIT: The answer turned out to be simple (I thought it might be). If it turns out that k and p are not co-prime, replace a with a+p. My apologies for stating the problem incorrectly, as the original problem asked to find an a such that [a] was a generator.

REPLY [3 votes]: There are examples of odd primes $p$ and generators $a$ for the group of units modulo $p$ such that $p^2$ divides $a^{p-1}-1$, so if the problem is as you say it is, it is asking the impossible. See, for example, https://mathoverflow.net/questions/27579/is-the-smallest-primitive-root-modulo-p-a-primitive-root-modulo-p2