Prove $U(5)\cong\mathbb{Z}_4$ and generalize this result to $U(p)$ where $p$ is prime. The first part of the question is simple, and it is the second part of question where I can't find a general way to do. I intuitively recognize it is true and I can tell $|U(p)|=|\mathbb{Z}_{p-1}|$, moreover for some elements in these two groups I can show that they have the same order, for example, $(p-1)\in U(p)$ and $(p-1)/2 \in\mathbb{Z}_{p-1}$ are order 2 elements. So I wonder if anyone can give me a general method to finish the proof.
 A: This is not really easy if you have no indications. In fact, you can prove more generally that if $K$ is a field, then every finite subgroup $G$ of $K^\times$ is cyclic. Then , apply this result to $K=\mathbb{Z}/p\mathbb{Z}$ to deduce the result you want.
One of the possible proofs goes as follows.
Let $G$ be a finite subgroup of $K^\times$.
Let $e$ be the exponent of $G$, that is the smallest integer $n\geq 1$ satisfying $x^n=1$ for all $x\in G$. It is well-known that since $G$ is finite abelian, there exists an element $x_0\in G$ of order $e$ (see proof below).
Assuming this fact for the moment, let $n$ be the order of $G$, and let $x_0$ be an element of $G$ of order $e$, where $e$ is the exponent of $G$. Since $x_0$ has order $e$, we have $n\geq e$. Now, since $G$ has exponent $e$, the $n$ elements of $G$ are roots of $X^e-1\in K[X]$. Since $K$ is a field, this polynomial has at most $n$ roots, hence $n\leq e$. Therefore $n=e$, and since $\langle x_0\rangle\subset G$, the equality of orders forces $G=\langle x_0\rangle$. Hence, $G$ is cyclic.
It remains to prove that a finite abelian group $G$ of exponent $e$ has an element of order $e$.  Write $e=p_1^{n_1}\cdots p_r^{n_r}$. It is easy to see that $e=lcm(o(x),x\in G)$.
Since $p_i^{n_i}\mid e$, it means that there exists $y_i\in G$ such that $p_i^{n_i}\mid o(y_i)$ (otherwise $p_i^{n_i}$ would not divide the lcm of all orders).
Now,  if $o(y_i)=p_i^{n_i}q_i$, then $o(y_i^{q_i})=p_i^{n_i}$. Since $y_1^{q_1},\ldots y_r^{q_r}$ pairwise commute and have pairwise coprime orders, $x_0=y_1^{q_1}\cdots y_r^{q_r}$ has order $p_1^{n_1}\cdots p_r^{n_r}=e$.
