<s>[INST] If for a prime p $1+\frac{1}{2}+\frac{1}{3}+\ldots + \frac{1}{p-1}=\frac{a}{b}$ then show that p divides a. Moreover if $p>3$ then $p^2$ divides a. Here is a problem from Hersteins Topics in Algebra:

If $1+\frac{1}{2}+\frac{1}{3}+\ldots + \frac{1}{p-1}=\frac{a}{b}$ for a prime $p$, then show that $p$ divides $a$. Moreover if $p>3$ then $p^2$ divides $a$. 

I am able to prove the first part by writing 
$$1+\frac{1}{2}+\frac{1}{3}+\ldots + \frac{1}{p-1}=\frac{(p-1)!+ \frac{(p-1)!}{2}+\frac{(p-1)!}{3}+\ldots + 1 }{(p-1)!},$$
where we can show the numerator to be congruent to $0$ mod $p$. I can't seem to crack the second part. Thanks in advance for any help. 
 [/INST] The numerator is $(p-1)!\left ( \frac 11 + \frac 12 + ... + \frac 1{p-1}\right )  \equiv (p-1)!\left ( 1^{-1} + 2^{-1} + ... + (p-1)^{-1}\right ) \mod {p^2}$.
The Euler function for $p^2$ is $p(p-1)$. Thus, for any $k \lt p  $ ,   $k^{-1} \equiv k^{p(p-1)-1}\mod p^2$.
Thus, $k^{-1} + (p-k)^{-1} \equiv k^{p(p-1)-1} + (p-k)^{p(p-1)-1} \equiv k^{p(p-1)-1} + p^2.c + (-k)^{p(p-1)-1} $ ($\because p \gt 3$). Also, as $p(p-1)-1$ is odd, hence $(-k)^{p(p-1)-1} \equiv (-1).(k)^{p(p-1)-1}$. Thus, $k^{p(p-1)-1} + (p-k)^{p(p-1)-1} \equiv 0 \mod p^2$. Hence numerator is divisible by $p^2$.
</s>