Here is a "MAD PROOF" :
Let $p>2$ a prime number, an integer $k\ge 1$ and $x$ an integer.
To start we have that $p^k \vert (x-1)(x+1)$. We want to say that $p^k\vert (x-1)$ or $p^k\vert(x+1)$. To assume such a statement we need Gauss lemma which means that we must prove that $\gcd(p^k,x-1)=1$ or $\gcd(p^k,x+1)=1$.
To do this the first thing to do is to prove that $\gcd(p,x-1)=1$ or $\gcd(p,x+1)=1$.
Here we go :
We suppose that $p$ does not divide $x$. (Indeed if $p\vert x$ then there exists $j\in\mathbb{Z}$ such that $pj=x \Rightarrow pj\pm 1=x\pm 1$ and with the fact that $p>2$ is a prime number, then $p$ cannot divide $(x\pm 1)$).
By Fermat little theorem we have $x^{p-1}\equiv 1\ [p]\Leftrightarrow x^{p-1}-1\equiv 0\ [p]\Leftrightarrow (x-1)\sum\limits_{k=0}^{p-2}x^k\equiv 0\ [p]$.
By hypothesis $p>2$ is a prime number so by Euclid's lemma $p\vert (x-1)$ or $p\vert\sum\limits_{k=0}^{p-2}x^k$.
In the second case, it means that $p$ does not divide $(x-1)$ and $p>2$ is a prime number so directly $\gcd(p,x-1)=1$.
In the first case, there exists $u\in \mathbb{Z}$ such that $pu=x-1\Rightarrow pu+2=x+1$. And by hypothesis $p$ cannot divide $2$ so $p$ does not divide $(x+1)$. That's why $\gcd(p,x+1)=1$.
Now, with the beautiful properties of $\gcd$ we have $\gcd(p,x-1)=1$ and $p$ which is coprime with $(x-1)$ so $\gcd(p^2,x-1)=\gcd(p,x-1)=1$ (you can see it by multiplying two Bachet-Bézout's identities and by a re-arrangement of the coefficients). We repeat the operation $k-1$ times and obtain $\gcd(p^k,x-1)=\gcd(p,x-1)=1$. Same for $(x+1)$.
We can now apply Gauss lemma and the exercise is done !