Let $d$ be a divisor of $n$. It is natural to ask the following question: Does a unit $a$ modulo $d$ lifts to a unit modulo $n$, i.e., if $a$ is a unit modulo $d$, then does there exist a unit $b$ modulo $n$ such that $a \equiv b \pmod{d}$? Note that if $a$ is a unit modulo $n$, then it must also be a unit modulo $d$ since $(a, n) = 1$ implies $(a, d) = 1$. Thus $a$ being a unit modulo $d$ is a necessary condition. Consider the canonical projection map $\pi : \mathbb{Z}/n\mathbb{Z} \to \mathbb{Z}/d\mathbb{Z}$ defined as $\pi(a \pmod{n}) = a \pmod{d}$. It is easy to verify that $\pi$ is a ring homomorphism which maps identity to identity element. Thus $\pi$ induces the group homomorphism $\pi^{\times} : (\mathbb{Z}/n\mathbb{Z})^{\times} \to (\mathbb{Z}/d\mathbb{Z})^{\times}$. The question of lifting of units can be reformulated as: Is the induced map $\pi^{\times}$ surjective? We now show below that the answers to this question is yes using Chinese Remainder Theorem.
Let $b \in (\mathbb{Z}/d\mathbb{Z})^{\times}$ and let $q$ be the product of prime divisors of $n$ that do not divide $n$. Then $(q, d) = 1$ and so by Chinese Remainder Theorem there exists $a$ such that
\[a \equiv b \pmod{d} \quad \text{and} \quad a \equiv 1 \pmod{q}. \] It now follows that $(a, n) = 1$ and so $a \in (\mathbb{Z}/n\mathbb{Z})^{\times}$ and $\pi^{\times}(a \pmod{n}) = b \pmod{d}$. Hence, $\pi^{\times}$ is surjective and consequently
\[
(\mathbb{Z}/n\mathbb{Z})^{\times} / \ker \pi^{\times} \cong (\mathbb{Z}/d\mathbb{Z})^{\times}
\] As a result $|\ker \pi^{\times}| = \varphi(n)/\varphi(d)$. We can write this result in summation notation as
\[
\sum_{\scriptstyle a = 1 \atop {\scriptstyle (a, n) = 1 \atop \scriptstyle a \equiv 1 \pmod{d}}}^{n} 1 = \frac{\varphi(n)}{\varphi(d)}.
\]
As an application we evaluate the sum
\[
\sum_{\scriptstyle a =1 \atop \scriptstyle (a, n) = 1}^{n} (a- 1, n).
\] Note that the above sum is
\[
\sum_{\scriptstyle a =1 \atop \scriptstyle (a, n) = 1}^{n} \sum_{d \, | \, (a- 1, n)} \varphi(d) = \sum_{\scriptstyle a =1 \atop \scriptstyle (a, n) = 1}^{n} \sum_{\scriptstyle d \, | \, n \atop \scriptstyle d \, | \, a- 1} \varphi(d).
\] Interchanging the order of summation we find that the sum is
\[
\sum_{d \, | \, n} \varphi(d) \sum_{\scriptstyle a = 1 \atop {\scriptstyle (a, n) = 1 \atop \scriptstyle a \equiv 1 \pmod{d}}}^{n} 1 = \sum_{d \, | \, n} \varphi(d) \frac{\varphi(n)}{\varphi(d)} = \varphi(n) d(n).
\]