I had an exercise for homework for a class that said prove $$(k+1)^p-k^p\equiv 1\pmod{p}$$ for all $k=0,1,....$ So I use the binomial formula to expand $$1=1^p=(k+1-k)^p=((k+1)-k)^p$$ $$=(k+1)^p+\left(\sum_{m=1}^{p-1}\binom{p}{m}(-1)^{m+1}(k+1)^{p-m}k^m\right)-k^p$$ But since $\binom{p}{m}=p\frac{(p-1)!}{(p-m)!m!)}\equiv 0\pmod{p}, (k+1)^p-k^p\equiv 1\pmod{p}.$
But the next task is to use this information to derive Fermat's theorem and I'm not sure now to get the expression in the form $a^{p-1}$. Any hint would help...
You've shown that $$ a^p-a\equiv0\pmod{p}\tag{1} $$ for all $a$. Now, remember that since $p$ is prime, $p\mid ab\implies p\mid a\lor p\mid b$. Now, $(1)$ is $$ a(a^{p-1}-1)\equiv0\pmod{p}\tag{2} $$