$\mathbb Z_p^*$ is a group. I'm trying to prove that $\mathbb Z_p^*$ ($p$ prime) is a group using the Fermat's little theorem to show that every element is invertible.
Thus using the Fermat's little theorem, for each $a\in Z_p^*$, we have $a^{p-1}\equiv1$ (mod p). The problem is to prove that p-1 is the least positive integer which $a^{p-1}\equiv1$ (mod p).
Remark: $\mathbb Z_p^*$ is $\{\overline 1,...,\overline {p-1}\}$ with multiplication.
I need help.
Thanks a lot.
 A: You can't show that $p-1$ is the least positive integer $r$ such that $a^r\equiv 1\pmod{p}$, because in general it isn't: for instance, the least integer for $a=1$ is $1$.
But all you need is to find an element which acts as an inverse:
$$a\cdot a^{p-2} \equiv 1 \pmod{p}$$
so that, for any $\overline{x}\in\mathbb{Z}^*_p$ you have
$$\overline{x}\cdot\overline{x}^{\,p-2} = \overline{1}$$
and so
$$\overline{x}^{\,-1}=\overline{x}^{\,p-2}$$
A: Please check my inverse solution.
Let $\overline{x} \in \mathbb{Z}_{p}^*$. Then $(x,p)=1$, that is there exist $k, q \in \mathbb{Z}$ such that $kx + qp=1$. This implies $\overline{k}\overline{x}=\overline{1}$. Suppose that $\overline{k}=\overline{0}$. Then $\overline{0}=\overline{1}$, a contradict. Thus $\overline{k} \not = \overline{0}$, so $k \not = 0$.
Now, we write $k=mp+r$ where $0 \leq r < p$. If $k<p$, then $(k,p)=1$. It follows that $\overline{k} \in \mathbb{Z}_{p}^*$. If $k=p$, then $r=0$. It follows that $\overline{k}=\overline{0}$, a contradict, thus $k \not = p$. If $k>p$, then we have $k=mp+r$ where $0 < r < p$. Hence $\overline{r} \in \mathbb{Z}_p^*$. Since $k \equiv r \, (\mod p)$, $\overline{k} \in \mathbb{Z}_p^*$.
Therefore $\mathbb{Z}_p^*$ has inverse.
A: In my case I made an Isomorphism between $\mathbb{Z}^*_p = \{1,2,3,...,p-1\}$ and all the Automorphisms of a Group G of order p which is of the form $\varphi_{x}(g)=g^{x}$ (Where $x \in \mathbb{Z}^*_p$ and $g \in G$, I hope you can know the demonstration of this first part). That's the key, due to G is of prime order, that's cyclic with no subgroups, I said $\forall x \in \mathbb{Z}^*_p, \varphi_{x}(g) = g^{x} \neq e$.
And now, you know that all Automorphism made a group under composition and  $x,y \in \mathbb{Z}^*_p, \varphi_{x}  \circ \varphi_{y} = \varphi_{xy}$ then $\mathbb{Z}^*_p$ is a group too!
