Congruence involving prime numbers Given the function $f(x)= x^{\frac{p(p-1)}{2}}-1.$ Also let $p$ be an odd prime number. If $\epsilon$ is a number $\pmod{p}$ such that
$f(\epsilon) \equiv 0 \pmod{p}$. Then how do I prove ( prove because Hardy and Wright use it but don't prove it ) that 
$$ f(\epsilon)\equiv 0 \pmod{p^2}$$ 

Let $f(x) = x^{p(p-1)/2} - 1$. Suppose we have an integer $a$ such that $f(a) \equiv 0 \pmod{p}$.
First, suppose $p \mid a$. Then, $f(a) = a^{p(p - 1)/2} - 1 \equiv -1 \pmod{p}$, a contradiction. 
Then, suppose $p \nmid a$. By Euler's Theorem, $a^{\phi(p^2)} = a^{p(p - 1)} \equiv 1 \pmod{p^2}$. Treating this as a quadratic congruence $(a^{p(p-1)/2})^2 \equiv 1 \pmod{p^2}$, we see that $a^{p(p - 1)/2} \equiv \pm 1 \pmod{p^2}$.
If $a^{p(p - 1)/2} \equiv -1 \pmod{p^2 }$, we imply $a^{p(p - 1)/2} \equiv -1 \pmod{p}$, so $a^{p(p - 1)/2} - 1 = f(a) \equiv -2 \not \equiv 0 \pmod{p}$, a contradiction. Thus, we conclude that $a^{p(p - 1)/2} \equiv 1 \pmod{p^2}$, or $f(a) \equiv 0 \pmod{p^2}$, as desired.
