TITLE: Why $f\colon \mathbb{Z}_n^\times \to \mathbb{Z}_m^\times$ is surjective?
QUESTION [5 upvotes]: If $m|n$. Why the map $f\colon \mathbb{Z}_n^\times \to \mathbb{Z}_m^\times$ given by $a \mod{n}\mapsto a \mod m$ is a surjective homomorphism of groups?
Attempt: I proved it is well a well defined homomorphism because the canonical projection $\overline{f}\colon \mathbb{Z}_n \to \mathbb{Z}_m$ is a surjective ring homomorphism, it extends $f$ and maps units to units.
But I can't prove surjectiveness. Given $a\in\mathbb{Z}$ such that $(a,m)=1$ I'm looking for a $k\in\mathbb{Z}$ such that $(a+k\cdot m,n)=1$. I don't know why one of the $n/m$ candidates for such $k$ makes the number $a+k\cdot m$ an unit modulo $n$.

REPLY [3 votes]: Let $n=p_1^{\alpha_1}\cdots p_k^{\alpha_k}$ and $m=p_1^{\beta_1}\cdots p_k^{\beta_k}$, with $\alpha_i\geq \beta _i$. Then $$\Bbb Z_n^\times =\prod^{k}_{i=1} \Bbb Z_{p_i^{\alpha_i}}^\times\text{ and }\Bbb Z_m^\times = \prod^{k}_{i=1} \Bbb Z_{p_i^{\beta_i}}^\times$$
The surjectivity of $\Bbb Z_m^\times \to \Bbb Z_n^\times$ follows from the surjectivity of
$\Bbb Z^\times_{p_i^{\alpha_i}}\to\Bbb Z^\times_{p_i^{\beta_i}}$.