Background
For elementary number theory class, I have to prove Wilson's theorem. Attached is the problem from the textbook.
My Work So Far
Proof: Let $p\in\mathbb{Z}$ be prime. Consider the linear congruence $x^2\equiv x\cdot x\equiv 1\mod p$. Without loss of generality, by Fermat's Little Theorem, choose an inverse $x^{-1}\equiv x\equiv x^{p-2}$ such that $x\cdot x^{p-2}\equiv 1\mod p$. Observe that $$x\cdot x\equiv x^{p-2}\cdot x\mod p$$ Equivalently, $$x^2\equiv x^{p-1}\mod p$$By definition, we see that $p\mid x^2-x^{p-1}=x(x-x^{p-2})$. From Exercise 16, we know that the linear congruence $x^2\equiv 1\mod p$ has two possible solutions $$x\equiv 1\mod p$$ $$x\equiv -1\mod p$$ As such, by definition $$p\mid (x-1)$$ $$p\mid (x+1)$$ Recall that $x\equiv x^{p-2}\mod p$ and $x\equiv x\mod p$. We have $p\mid (x^{p-2}-1)(x+1)$. By Lemma 3 (in textbook), $$p\mid (x^{p-2}-1)$$ $$p\mid (x+1)$$ So, there are two possible solutions $$x^{p-2}\equiv 1\mod p$$ $$x\equiv -1\mod p$$ From above, notice that $x^{p-3}\cdot x\equiv 1\mod p$. End of work so far.
I also noticed that since we are considering a set $(1, p-1)$ (i.e., not including $1$ and $p-1$) we are left with $p-3$ terms to generate pairs that are inverses of each other.
My Request
I would like some help by pointing out any flaws and giving hints. ONLY HINTS and ADVICE Thank you :)