Can you please help of how can I approach this proof. I have seen a proof of the power sum of p in the internet but it doesn't seem very helpful. I want to show that
$S_m(p^2)$ is congruent to $-p$ mod $p^2$, when $(p-1) \not | m$, where $p$ is a prime.
Let us rewrite things clearly for $p>2$ and $m\geq 1$: $$S_m(p^2)=\sum_{k=1}^{p^2} k^{m} \,\,\, (*)$$
Given an element $a$ such that $gcd(a,p)=1$ the function $k \to a^mk$ is bijective so: $$a^mS_m(p^2)=\sum_{0<k<p^2,gcd(k,p)=1} (ak)^m\mod p^2\\ =\ \ \ \ \ S_m(p^2) \mod p^2 $$
This signifies that $S_m(p^2)=0$ or $\forall a\in \mathbb{Z}_{p^2}$ $a^m=1 \mod p^2$ which contradicts $p-1$ divides $m$, so: $$ S_m(p^2)=0 \mod p^2 $$
now to finish we have to prove that $S_m(p)=-1 \mod p$ which is easy because $j^m=1$ ($p-1$ divide $p$) for all $0<j\leq p-1$