Solution to Abstract Algebra by Dummit & Foote 3rd edition Chapter 1.1 Exercise 1.1.29
Let $A$ and $B$ be groups. Prove that $A \times B$ is abelian if and only if $A$ and $B$ are abelian.
Solution:
($\Rightarrow$) Suppose $a_1, a_2 \in A$ and $b_1, b_2 \in B$. Then $$(a_1 a_2, b_1 b_2) = (a_1, b_1) \cdot (a_2, b_2) = (a_2, b_2) \cdot (a_1, b_1) = (a_2 a_1, b_2 b_1).$$ Since two pairs are equal precisely when their corresponding entries are equal, we have $a_1 a_2 = a_2 a_1$ and $b_1 b_2 = b_2 b_1$. Hence $A$ and $B$ are abelian.
($\Leftarrow$) Suppose $(a_1, b_1), (a_2, b_2) \in A \times B$. Then we have $$(a_1, b_1) \cdot (a_2, b_2) = (a_1 a_2, b_1 b_2) = (a_2 a_1, b_2 b_1) = (a_2, b_2) \cdot (a_1, b_1).$$ Hence $A \times B$ is abelian.