Let n $\prod_{i=1}^k p_{i}^{e_i}$ with $k\in \mathbb{N}$, $p_i\neq p_j \in \mathbb{P}, \quad \forall i\neq j$ and $e_i \in \mathbb{N}^+$. Then for Euler's totient function follows:
$$\phi(n)=\prod_{i=1}^k (p_i-1)p_{i}^{e_i-1}$$
I have to prove this theorem in the 3 following steps:
1) The formula holds for $n=p^{e_i}$.
This step is done by considering that all numbers $k$ with $gcd(n,k)\neq 1$ have to be multiplicatives of p and there are $p^{e_i-1}$ of them, therefore $\phi(n)=p^{e_i}-p^{e_i-1}$.
2) A residue class is prime modulo $m$, iff it is a unit in the multiplicative semigroup of $\mathbb{Z}_m$.
3) Use the Chinese remainder theorem and (2) to reduce the problem for arbitrary $n$ to the one of the prime power.
My problem is that I don't know how to prove that for any unit in $\mathbb{Z}_m$ follows that it has to be a prime residue class. The other direction clear to me I can state it if needed.
I would really appreciate some help!