I am studying group theory so I do it by using the concept of group.
What I am trying to prove is if p is prime then $(p-1)!\equiv-1\mod p$
Note that $\mathbb{Z_p}$ forms a multiplicative group. Hence $\forall a \in \{1,2,\dots,p-1\},\exists a^{-1}\in \{1,2,\dots,p-1\}$
This means that $aa^{-1}\equiv 1\mod p$
If $a=a^{-1}, 1 \equiv aa^{-1}= a^2 \mod p$, So this means that $a \equiv \pm 1 \mod p$. (I am not sure that why this is true, is it because the group is abelian?)
"We have seen that this necessitates $a ≡ ±1 (\mod p)$ and so a = 1 or a = p − 1." ( I totally can't understand this sentence.)
Then we pair up $(p-1)!=1(2)\dots(p-2)(p-1)$ such that every element is with their multiplicative inverse.
So all the other pairs get $-1$ except for the pair ((1)(p-1)). Why this will happens?
I am not familiar with number theory so I hope I can get some idea or explaination about those statements.