In general, is $U(R\times S) \cong U(R)\times U(S)$? How do I show it? Some context: I'm trying to find $\text{Aut}(\mathbb{Z}_n)$ for any natural number $n$ (Problem I.2.15c in Hungerford, if you're wondering), and I'm using the Chinese Remainder Theorem to deduce that if $$n=p_1^{r_1}\dots p_k^{r_k},$$ then $$\mathbb{Z}_n \cong \mathbb{Z}_{p_1^{r_1}} \times \dots\times \mathbb{Z}_{p_k^{r_k}},$$ and since $\text{Aut}(\mathbb{Z}_n)$ has the same order as $U(\mathbb{Z}_n)$ (I'm thinking they're isomorphic, too, but I can't think of a way to prove it), I'd think $$U(\mathbb{Z}_n)\cong U(\mathbb{Z}_{p_1^{r_1}}) \times\dots\times U(\mathbb{Z}_{p_k^{r_k}}).$$ That's the source of my question. From there, I know $U(\mathbb{Z}_{p_i^{r_i}})$ has order $p_i^{r_i} - p_i^{r_i-1}$, but I'm hard pressed to determine general structure. I know $U(\mathbb{Z}_{p_i^{r_i}})$ is a product of cyclic groups (since it's abelian) of orders of powers of $p$ with the last cyclic group of the product having order $p^j (p-1)$ , but I have no idea what else I can say about them specifically.
Thanks so much!
 A: The more common notation for the cyclic group (ring) of order $n$ is $\mathbb{Z}/n\mathbb{Z}$, since $\mathbb{Z}_p$ usually denotes the $p$-adic integers. Also, I will denote the multiplicative group of units of a ring $R$ by $R^\times$.
First, it seems pretty hard to me to prove that $\text{Aut}(\mathbb{Z}/n\mathbb{Z})$ has the same order as $(\mathbb{Z}/n\mathbb{Z})^\times$ without actually proving that they are isomorphic. The proof can be found in almost any algebra text book and goes as follows: fix a generator $x$ of $\mathbb{Z}/n\mathbb{Z}$. The action of any automorphism is determined by what it does to $x$, and the result can again be expressed as a power of $x$ ($x$ being a generator). The map $\sigma_i: x\mapsto x^i$ is an automorphism if and only if $x^i$ has the same order as $x$ if and only if $i$ is coprime to $n$, and different $i$ define different automorphisms. Moreover, composition $\sigma_i\circ\sigma_j$ corresponds to multiplication $ij$, so $\sigma_i\mapsto i$ establishes an isomorphism between $\text{Aut}(\mathbb{Z}/n\mathbb{Z})$ and $(\mathbb{Z}/n\mathbb{Z})^\times$.
Next, the fact that $(R\times S)^\times = R^\times\times S^\times$ is true for any rings $R$ and $S$. This just follows from the definition of direct products, specifically of the multiplication of elements of a direct product.
Finally, given a prime $p$ and an integer $k$, the group of units $(\mathbb{Z}/p^k\mathbb{Z})^\times$ is cyclic (of order $p^k-p^{k-1}$) if $p$ is odd, and is isomorphic to $\mathbb{Z}/2\mathbb{Z}\times \mathbb{Z}/2^{k-2}\mathbb{Z}$ if $p=2$ and $k\geq 2$. That is a bit harder to prove than all of the above, but a proof can also be found in many places. I don't have Hungerford in front of me, so don't know if it's in there, but you can find it online, e.g. here.
