I think it easier to see this from an adelic point of view. I prefer to use $I =\mathbb{A}^\times$ for the ideles.
Using strong approximation:
$$ \mathbb{A}^\times = \mathbb{Q}^\times \times \prod\limits_p \mathbb{Z}_p^\times \times \mathbb{R}^\times$$$$ \mathbb{A}^\times = \mathbb{Q}^\times \times \prod\limits_p \mathbb{Z}_p^\times \times \mathbb{R}^\times $$
Accordingly, we can factor a Hecke character $\chi$ on $\mathbb{Q}^\times \backslash \mathbb{A}^\times $ to character $\chi_p$ for all $p$ (all but finitely many trivial by Tychonoff's theorem) and $\chi_\infty$.
Now a continuous character $\chi_p$ on $\mathbb{Z}_p^\times$ must factor through $\mathbb{Z}_p^\times / 1 + p^k \cong ( \mathbb{Z} / p^k)^\times$$\mathbb{Z}_p^\times /(1 + p^k\mathbb{Z}_p) \cong ( \mathbb{Z} / p^k)^\times$.
In the end, we use the Chinese remainder theorem (this is essentially the approximation property above)
$$ (\mathbb{Z}/N)^\times = \prod\limits_{p^k || N }(\mathbb{Z}/p^k)^\times.$$