[step:Parametrise homomorphisms $G \to \mathbb{C}^\times$ by tuples of roots of unity]We claim there is a bijection
\begin{align*}
\Psi : \hat G &\to \mu_{n_1} \times \cdots \times \mu_{n_r} \\
\rho &\mapsto (\rho(x_1), \ldots, \rho(x_r)),
\end{align*}
where $\mu_n := \{\zeta \in \mathbb{C}^\times : \zeta^n = 1\}$ is the set of $n$th roots of unity.
**$\Psi$ is well-defined.** Given $\rho \in \hat G$ and $j \in \{1, \ldots, r\}$, let $\lambda_j := \rho(x_j)$. Since $x_j^{n_j} = e$ in $G$ and $\rho$ is a homomorphism,
\begin{align*}
\lambda_j^{n_j} = \rho(x_j)^{n_j} = \rho(x_j^{n_j}) = \rho(e) = 1.
\end{align*}
Hence $\lambda_j \in \mu_{n_j}$.
**$\Psi$ is injective.** Suppose $\Psi(\rho) = \Psi(\rho')$, i.e., $\rho(x_j) = \rho'(x_j)$ for all $j$. Every element of $G$ has the form $x_1^{j_1} \cdots x_r^{j_r}$ for some integers $j_1, \ldots, j_r$, and using the homomorphism property
\begin{align*}
\rho(x_1^{j_1} \cdots x_r^{j_r}) = \rho(x_1)^{j_1} \cdots \rho(x_r)^{j_r} = \rho'(x_1)^{j_1} \cdots \rho'(x_r)^{j_r} = \rho'(x_1^{j_1} \cdots x_r^{j_r}).
\end{align*}
So $\rho = \rho'$.
**$\Psi$ is surjective.** Given $(\lambda_1, \ldots, \lambda_r) \in \mu_{n_1} \times \cdots \times \mu_{n_r}$, define
\begin{align*}
\rho : G &\to \mathbb{C}^\times \\
x_1^{j_1} \cdots x_r^{j_r} &\mapsto \lambda_1^{j_1} \cdots \lambda_r^{j_r}.
\end{align*}
We must check this is well-defined: every $g \in G$ has a **unique** expression as $x_1^{j_1} \cdots x_r^{j_r}$ with $0 \leq j_k < n_k$ (because $G$ is the internal direct product of the $\langle x_k \rangle$ with $|x_k| = n_k$), but the formula is given for arbitrary integer exponents, so we must check that two different integer tuples representing the same element produce the same value. If $x_1^{j_1} \cdots x_r^{j_r} = x_1^{j_1'} \cdots x_r^{j_r'}$ in $G$, then by uniqueness of the direct product decomposition $j_k \equiv j_k' \pmod{n_k}$ for each $k$. Since $\lambda_k^{n_k} = 1$, we have $\lambda_k^{j_k} = \lambda_k^{j_k'}$, so the formula gives the same value. Hence $\rho$ is a well-defined function.
It is a homomorphism because in the direct product $G$, multiplication is componentwise:
\begin{align*}
(x_1^{j_1} \cdots x_r^{j_r}) \cdot (x_1^{k_1} \cdots x_r^{k_r}) = x_1^{j_1+k_1} \cdots x_r^{j_r+k_r},
\end{align*}
and $\rho$ sends the product to $\lambda_1^{j_1+k_1} \cdots \lambda_r^{j_r+k_r} = (\lambda_1^{j_1} \cdots \lambda_r^{j_r})(\lambda_1^{k_1} \cdots \lambda_r^{k_r})$.
By construction $\Psi(\rho) = (\lambda_1, \ldots, \lambda_r)$, so $\Psi$ is surjective.[/step]