[proofplan]
We transfer the statement from $\mathbb{Z}/M\mathbb{Z}$ to a product via the CRT isomorphism and track units. First we observe that $\varphi(n)$ is, by the [Units in $\mathbb{Z}/n\mathbb{Z}$](/theorems/1699) characterisation, the cardinality of the unit group $(\mathbb{Z}/n\mathbb{Z})^\times$. Under the [Ring Isomorphism Form of CRT](/theorems/1702), units map to units componentwise, yielding a group isomorphism between $(\mathbb{Z}/M\mathbb{Z})^\times$ and $\prod_i (\mathbb{Z}/m_i\mathbb{Z})^\times$. Taking cardinalities gives the multiplicativity formula.
[/proofplan]
[step:Express $\varphi$ as the cardinality of a unit group]
For every $n \geq 1$, define
\begin{align*}
(\mathbb{Z}/n\mathbb{Z})^\times &= \{a + n\mathbb{Z} : (a, n) = 1\}
\end{align*}
to be the group of units of the ring $\mathbb{Z}/n\mathbb{Z}$. By the [Units in $\mathbb{Z}/n\mathbb{Z}$](/theorems/1699) theorem, an element $a + n\mathbb{Z}$ is a unit in $\mathbb{Z}/n\mathbb{Z}$ if and only if $(a, n) = 1$. Since $\varphi(n)$ is defined as the number of integers $a$ in $\{1, 2, \ldots, n\}$ with $(a, n) = 1$, we have
\begin{align*}
|(\mathbb{Z}/n\mathbb{Z})^\times| &= \varphi(n).
\end{align*}
[guided]
Recall that Euler's totient $\varphi(n)$ counts integers $a$ in the range $1 \leq a \leq n$ with $(a, n) = 1$. Such integers correspond bijectively to residue classes $a + n\mathbb{Z}$ with $(a, n) = 1$, and this coprimality condition depends only on the class (since $(a + kn, n) = (a, n)$ for any $k$). By the [Units in $\mathbb{Z}/n\mathbb{Z}$](/theorems/1699) theorem, a residue class $a + n\mathbb{Z}$ admits a multiplicative inverse modulo $n$ if and only if $(a, n) = 1$. Hence the set of unit classes is exactly $\{a + n\mathbb{Z} : 1 \leq a \leq n,\ (a,n) = 1\}$, of cardinality $\varphi(n)$. This identification $\varphi(n) = |(\mathbb{Z}/n\mathbb{Z})^\times|$ converts an arithmetic count into a group-theoretic invariant, which is the key to applying CRT.
[/guided]
[/step]
[step:Transfer the CRT isomorphism to unit groups]
By the [Ring Isomorphism Form of CRT](/theorems/1702), the map
\begin{align*}
\Theta: \mathbb{Z}/M\mathbb{Z} &\to \mathbb{Z}/m_1\mathbb{Z} \times \cdots \times \mathbb{Z}/m_k\mathbb{Z} \\
a + M\mathbb{Z} &\mapsto (a + m_1\mathbb{Z},\, \ldots,\, a + m_k\mathbb{Z})
\end{align*}
is a ring isomorphism, since the hypothesis of pairwise coprime $m_i$ is exactly what the theorem assumes. Any ring isomorphism sends units to units and its restriction to unit groups is a group isomorphism. The unit group of a product of rings is the product of the unit groups componentwise:
\begin{align*}
(R_1 \times \cdots \times R_k)^\times &= R_1^\times \times \cdots \times R_k^\times,
\end{align*}
because a tuple $(r_1, \ldots, r_k)$ has multiplicative inverse $(r_1^{-1}, \ldots, r_k^{-1})$ iff each $r_i$ is invertible. Restricting $\Theta$ therefore yields a group isomorphism
\begin{align*}
\Theta\big|_{(\mathbb{Z}/M\mathbb{Z})^\times}: (\mathbb{Z}/M\mathbb{Z})^\times &\stackrel{\sim}{\longrightarrow} (\mathbb{Z}/m_1\mathbb{Z})^\times \times \cdots \times (\mathbb{Z}/m_k\mathbb{Z})^\times.
\end{align*}
[guided]
A ring isomorphism $\Theta: R \to S$ sends the unit group $R^\times$ bijectively onto $S^\times$: if $r \in R^\times$ with inverse $r^{-1}$, then $\Theta(r) \cdot \Theta(r^{-1}) = \Theta(r \cdot r^{-1}) = \Theta(1) = 1$, so $\Theta(r) \in S^\times$; the inverse map $\Theta^{-1}$ sends units back to units for the same reason. Moreover, $\Theta$ restricted to unit groups is a group homomorphism since $\Theta(rs) = \Theta(r)\Theta(s)$. Hence $\Theta|_{R^\times}: R^\times \to S^\times$ is a group isomorphism.
Now consider the product ring $S = R_1 \times \cdots \times R_k$. An element $(r_1, \ldots, r_k)$ is a unit iff there exists $(s_1, \ldots, s_k)$ with $(r_i s_i) = 1$ for every $i$, iff each $r_i$ is a unit. Therefore $S^\times = R_1^\times \times \cdots \times R_k^\times$. Applying this with $R_i = \mathbb{Z}/m_i\mathbb{Z}$ and combining with $\Theta$:
\begin{align*}
(\mathbb{Z}/M\mathbb{Z})^\times \cong (\mathbb{Z}/m_1\mathbb{Z})^\times \times \cdots \times (\mathbb{Z}/m_k\mathbb{Z})^\times.
\end{align*}
This is a group isomorphism, which is all we need for cardinalities.
[/guided]
[/step]
[step:Take cardinalities to conclude]
Both sides of the isomorphism from the previous step have the same cardinality. The left side has cardinality $\varphi(M)$. The right side, as a Cartesian product, has cardinality
\begin{align*}
|(\mathbb{Z}/m_1\mathbb{Z})^\times \times \cdots \times (\mathbb{Z}/m_k\mathbb{Z})^\times| &= \prod_{i=1}^k |(\mathbb{Z}/m_i\mathbb{Z})^\times| = \prod_{i=1}^k \varphi(m_i).
\end{align*}
Therefore
\begin{align*}
\varphi(M) &= \varphi(m_1) \cdots \varphi(m_k),
\end{align*}
which is the desired multiplicativity identity.
[/step]