Let $\mathit{p}$ be a prime natural number. Show that $\left ( p-1 \right )^{-1}=\left ( p-1 \right )$ in $\left ( \mathbb{Z}_{p}-\left \{ 0 \right \}, \cdot \right )$.
Attempt
I'm assuming that when they put something like $a \in \mathbb{Z}_{n}$, they mean $a$ is an equivalent class for the relation $\equiv_{n}$.
Lemma
Let $n \in \mathbb{N}$. Then for $\mathbb{Z}_{n}$, $\bar{0}=\bar{nk}$ for $k \in \mathbb{Z}$.
Lemma's Proof
By definition, $\bar{0}=\left \{ y:0\equiv _{n}y \right \}$ and $\bar{nk}=\left \{ a \in \mathbb{Z}:nk\equiv _{n}a \right \}$. But $0 \equiv _{n} y$ is equivalent to $n \mid -y$ , which is equivalent to $y=-mn$ for some $m \in \mathbb{Z}$. And $nk \equiv_{n}a$ is equivalent to $n \mid nk-a$, which is equivalent to $nk-a=ln$ for some $l \in \mathbb{Z}$. Therefore, $n(k-l)=a$. Let $k-l = -m$. Hence, $-mn=a=y$. Therefore, $\bar{0}=\bar{nk}$. $\square$
Main Proof
Let $\mathit{p}$ be a prime number and let $\left( p-1 \right )^{-1}$ be the inverse of $\left (p-1 \right)$ in the algebraic structure $\left ( \mathbb{Z}_{p}-\left \{ 0 \right \}, \cdot \right )$. 1 is the identity element of the algebraic structure, since $1 \cdot a = a$ for any element $a$ in the algabraic structure. Hence, $\left (p-1 \right )^{-1}\left (p-1\right ) = 1$ and $\left (p-1 \right )\left (p-1\right )^{-1} = 1$. Suppose $\left (p-1 \right )^{-1} \neq \left (p-1\right )$. Then (I think I need to show that the inverse is unique here) $$\left (p-1\right ) \left (p-1\right ) \neq 1$$ $$p^{2}-2p+1 \neq 1$$ $$p^{2}-2p \neq 0$$ $$p\left (p-2 \right ) \neq 0$$ Now, let $k = p -2$. Then by the lemma, $p\left (p-2 \right ) = 0$. Hence, $0 \neq 0$. Therefore, by contradiction, $\left (p-1 \right ) ^{-1} = \left ( p-1 \right )$
$\square$
What's the point of $p$ being prime? The given solution is much shorter than this, but I want to see if my logic is valid.
The logic of your proof is okay, but it's a bit strangely written. All you really need to say is that $(p-1)^2=p^2-2p+1,$ and $p^{2}-2p\equiv0\pmod{p}$ (because the left-hand side is a multiple of $p$), hence $(p-1)^{2}\equiv1\pmod{p},$ and this is the result.
Here's what I would write:
Other people might write this differently. For example, lots of people would start with $(p-1)^{2}\equiv(-1)^2\pmod{p}$ (note that $(-1)^{2}=1$).
The only reason I can see for assuming that $p$ is prime is so that every element of $\mathbb{Z}_{p}-\{0\}$ actually has an inverse, i.e., so that $(\mathbb{Z}_{p}-\{0\},\cdot)$ is a group. For example, the class of $2$ in $\mathbb{Z}_{4}-\{0\}$ has no inverse, and hence it is not clear what kind of mathematical structure the notation $(\mathbb{Z}_{4}-\{0\},\cdot)$ might be referring to.