The automorphism group of a direct product of abelian groups is isomorphic to a matrix group
Solution 1:
Like Qiaochu says, the key here is that the direct product of finitely many abelian groups functions as both the (categorical) product and the (categorical) coproduct in the category of abelian groups.
And before your eyes glaze over, what that means is that:
A homomorphism from an abelian group $A$ into a (finite) direct product $G_1\times G_2\times\cdots\times G_n$ of abelian groups is equivalent to a family $f_1,\ldots,f_n$ of homomorphisms $f_i\colon A\to G_i$; (in fact, this holds for arbitrary groups, and arbitrarily many direct factors, not just finitely many); and
A homomorphism from a finite direct product $G_1\times G_2\times\cdots\times G_n$ of abelian groups into an abelian group $B$ is equivalent to a family $g_1,\ldots,g_n$ of homomorphisms $g_i\colon G_i\to B$ (here we do need both finiteness and abelianness).
The first equivalence is easy: given a map $f\colon A\to G_1\times\cdots\times G_n$, the maps $f_i$ are just the compositions of $f$ with the canonical projections $\pi_i\colon G_1\times\cdots\times G_n\to G_i$; going the other way, given a family $f_1,\ldots,f_n$ of maps, you get the map $A\to G_1\times\cdots\times G_n$ by $f(a) = (f_1(a),f_2(a),\ldots,f_n(a))$.
For the second equivalence, given a homomorphism $g\colon G_1\times\cdots\times G_n\to B$, we define the maps $g_i\colon G_i\to B$ by restricting $g$ to the subgroup $\{0\}\times\cdots \times \{0\}\times B_i\times\{0\}\times\cdots\times\{0\}$. Conversely, given a family of homomorphisms $g_1,\ldots,g_n$, we construct the map $g$ by $g(x_1,\ldots,x_n) = g_1(x_1)+g_2(x_2)+\cdots+g_n(x_n)$; here, both the fact that the product has only finitely many factors and that the groups are abelian is important.
Now let $A=B=G_1\times\cdots\times G_n$. Then a homomorphism from $A$ to $B$ is equivalent, by 1, to a family of homomorphisms $\Phi_j\colon A\to G_j$. And by 2, each $\Phi_j$ is equivalent to a family of homomorphisms $\phi_{ij}\colon G_i\to G_j$. Thus, each homomorphism from $A$ to $B$ is equivalent to a family $\{\phi_{ij}\mid 1\leq i,j\leq n\}$, with $\phi_{ij}\colon G_i\to G_j$.
Now suppose you have two homomorphisms, $\Phi,\Psi\colon A\to B$, and you want to compose them. If $\Phi$ corresponds to $\{\phi_{ij}\}$ and $\Psi$ corresponds to $\{\psi_{ij}\}$, what does the composition correspond to in terms of maps $G_i\to G_j$?
If you trace the correspondence carefully, you should find that the induced map from $G_i$ to $G_j$ is precisely $$\psi_{i1}\circ\phi_{1j} + \psi_{i2}\circ\phi_{2j}+\cdots+\psi_{in}\circ\phi_{nj},$$ so that if you arrange the families $\{\phi_{ij}\}$ and $\{\psi_{ij}\}$ into matrices, composition corresponds to matrix multiplication in the usual way (though because composition is not commutative, you have to be mindful of the order of the products.
Once you have that endomorphisms can be "coded" as matrices with composition corresponding to matrix multiplication, the fact that automorphisms correspond to invertible matrices follows immediately. However, actually writing down a formula is complicated, because these matrices have entries that don't commute with one another; even in simple cases, like trying to do something like $C_{p^{\alpha}}\times C_{p^{\beta}}$ with $\alpha\gt\beta$, writing down the inverse of an automorphism in terms of its entries turns into a computation with congruences that is difficult to write down as a formula. But never fret, you aren't asked for an explicit formula.
Solution 2:
Here are some hints:
Given a general automorphism $\phi$, consider the restriction $\phi_i$ of $\phi$ to $G_i$ and composition with the projections $\pi_j:G\longrightarrow G_j$. What sort of animal is $\phi_{i,j}=\pi_j\circ \phi_i$? Show that the collection of these animals for $1\leq i,j\leq n$ determines $\phi$.
Now, let $\phi$ and $\psi$ be two distinct automorphisms. You want to investigate how they multiply, i.e. you want to understand $\phi\circ\psi$. As above, it is enough to understand $\pi_j\circ(\phi\circ\psi)_i=(\phi\circ\psi)_{i,j}$. Prove that $$ (\phi\circ\psi)_{i,j} = \sum_{k=1}^n \phi_{k,j}\circ\psi_{i,k}. $$ Of course, you should start by checking that the right hand side makes sense in the first place, i.e. that the domain of $\phi_{k,j}$ agrees with the codomain of $\psi_{i,k}$ and that the domains of the summands are the same, so that I can sum them.
Lastly, put all this together to answer the question.