Why are there $12$ automorphisms of $\Bbb Z\oplus \Bbb Z_{3}$?

I think that this can be nicely understood by thinking of $\mathbb{Z} \oplus (\mathbb{Z}/3)$ as a $\mathbb{Z}$-module and then representing group homomorphisms, i.e. $\mathbb{Z}$-module homomorphisms, as matrices:

We can write every homomorphism $f \colon \mathbb{Z} \oplus (\mathbb{Z}/3) \to \mathbb{Z} \oplus (\mathbb{Z}/3)$ as matrix $$ f = \begin{pmatrix} f_{11} & f_{12} \\ f_{21} & f_{22} \end{pmatrix} $$ for unique homomorphisms $f_{11} \colon \mathbb{Z} \to \mathbb{Z}$, $f_{12} \colon \mathbb{Z}/3 \to \mathbb{Z}$, $f_{21} \colon \mathbb{Z} \to \mathbb{Z}/3$ and $f_{22} \colon \mathbb{Z}/3 \to \mathbb{Z}/3$, such that $$ f\left( \begin{pmatrix} x \\ y \end{pmatrix} \right) = \begin{pmatrix} f_{11} & f_{12} \\ f_{21} & f_{22} \end{pmatrix} \cdot \begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} f_{11}(x) + f_{12}(y) \\ f_{21}(x) + f_{22}(y) \end{pmatrix}, $$ where we represent the elements of $\mathbb{Z} \oplus (\mathbb{Z}/3)$ as column vectors. Note that $f_{12} = 0$ because this is the only homomorphism $\mathbb{Z}/3 \to \mathbb{Z}$. Thus $f$ is of the form $$ f = \begin{pmatrix} f_{11} & 0 \\ f_{21} & f_{22} \end{pmatrix}. $$

If $f,g \colon \mathbb{Z} \oplus (\mathbb{Z}/3) \to \mathbb{Z} \oplus (\mathbb{Z}/3)$ are two homomorphisms then we can use the usual matrix multiplication $$ fg = \begin{pmatrix} f_{11} & 0 \\ f_{21} & f_{22} \end{pmatrix} \begin{pmatrix} g_{11} & 0 \\ g_{21} & g_{22} \end{pmatrix} = \begin{pmatrix} f_{11} g_{11} & 0 \\ f_{21} g_{11} + f_{22} g_{21} & f_{22} g_{22}. \end{pmatrix} $$ Because we have $$ \mathrm{id}_{\mathbb{Z} \oplus (\mathbb{Z}/3)} = \begin{pmatrix} \mathrm{id}_{\mathbb{Z}} & 0 \\ 0 & \mathrm{id}_{\mathbb{Z}/3} \end{pmatrix} $$ it follows that if $f$ is an isomorphism with $g = f^{-1}$, then \begin{align*} f_{11} g_{11} &= g_{11} f_{11} = \mathrm{id}_{\mathbb{Z}}, \\ f_{22} g_{22} &= g_{22} f_{22} = \mathrm{id}_{\mathbb{Z}/3}, \end{align*} so both $f_{11}$ and $f_{22}$ must be isomorphisms with $f_{11}^{-1} = g_{11}$ and $f_{22}^{-1} = g_{22}$.

If on the other hand $f_{11}$ and $f_{22}$ are isomorphisms then $$ \begin{pmatrix} f_{11} & 0 \\ f_{21} & f_{22} \end{pmatrix} \begin{pmatrix} f_{11}^{-1} & 0 \\ -f_{22}^{-1} f_{21} f_{11}^{-1} & f_{22}^{-1} \end{pmatrix} = \begin{pmatrix} \mathrm{id}_{\mathbb{Z}} & 0 \\ 0 & \mathrm{id}_{\mathbb{Z}/3} \end{pmatrix} $$ as well as $$ \begin{pmatrix} f_{11}^{-1} & 0 \\ -f_{22}^{-1} f_{21} f_{11}^{-1} & f_{22}^{-1} \end{pmatrix} \begin{pmatrix} f_{11} & 0 \\ f_{21} & f_{22} \end{pmatrix} = \begin{pmatrix} \mathrm{id}_{\mathbb{Z}} & 0 \\ 0 & \mathrm{id}_{\mathbb{Z}/3} \end{pmatrix}. $$ So $f$ is then already an isomorphism.

We now know that $f$ is an isomorphism if and only if both $f_{11}$ and $f_{22}$ are isomorphisms (i.e. as a lower triangular matrix, $f$ is invertible if and only if all diagonal entries are invertible). We can now simply count the number of such matrices: The two possible values of $f_{11}$ are the two automorphisms of $\mathbb{Z}$. The two possible values of $f_{22}$ are the two automorphims of $\mathbb{Z}/3$. For the entry $f_{12}$ we can pick any of the three homomorphims $\mathbb{Z} \to \mathbb{Z}/3$. Thus we have $2 \cdot 2 \cdot 3 = 12$ possible choices.


The problem is that $(1,\bar{1})$ does not generate $A$. It generates the subgroup of elements $(a,b)$ where $b$ is the residue class of $a$ mod $3$. In particular, for instance, this subgroup does not contain $(1,\bar{0})$.

To generate all of $A$, you need to take at least two elements, such as $x=(1,\bar{0})$ and $y=(0,\bar{1})$. If $f:A\to A$ is an automorphism, $f(y)$ must be an element of order $3$, so it must be either $(0,\bar{1})$ or $(0,-\bar{1})$. Then $f(x)$ must be an element which together with $(0,\pm\bar{1})$ generates all of $A$. The elements with this property are $(\pm1, b)$ for any $b\in\mathbb{Z}_3$.

This gives that there are at most $12$ different automorphisms of $A$: we have $2$ choices for where to send $y$, and $6$ choices for where to send $x$. You then have to verify that all of these choices really do define automorphisms of $A$. Let's verify this in the case that you choose plus signs everywhere, so we want $f(y)=(0,\bar{1})$ and $f(x)=(1,b)$ for some $b\in\mathbb{Z}_3$ (the other cases are similar). To get an automorphism with these properties, we can define $f(c,d)=(c,d+b\bar{c})$ (here $b\bar{c}$ is the product of $b$ and $c$ mod $3$). You can then check that $f$ is a homomorphism and a bijection (to get that it is a bijection, it might be helpful to observe that its inverse is $g(c,d)=(c,d-b\bar{c})$).


Consider presentation of $G$: $G=\langle x,y\colon y^3=1, xy=yx\rangle$.

Let $\sigma$ be any automorphism of $G$. Then $\sigma(y)$ could be $y$ or $y^2$ only (since $\langle y\rangle$ is torsion subgroup of $G$, so it is invariant under all the automorphisms).

What can be $\sigma(x)$? Of course, it could be $x,x^{-1}$. Anything more? Yes. $xy$, $x^{-1}y$, $xy^2$, $x^{-1}y^2$. That's all.

Thus, $\sigma(x)$ has two choices, $\sigma(y)$ has $6$ choices; each choice of $\sigma(x),\sigma(y)$ gives similar presentation of $G$, hence defines an automorphism. There are $12$.