Solution to Abstract Algebra by Dummit & Foote 3rd edition Chapter 1.6 Exercise 1.6.3
If $\varphi : G \rightarrow H$ is an isomorphism, prove that $G$ is abelian if and only if $H$ is abelian. If $\varphi : G \rightarrow H$ is only a homomorphism, what additional conditions on $\varphi$ (if any) are sufficient to ensure that if $G$ is abelian, then so is $H$?
Solution: Let $\varphi : G \rightarrow H$ be a group isomorphism.
($\Rightarrow$) Suppose $G$ is abelian, and let $h_1,h_2 \in H$. Since $\varphi$ is surjective, there exist $g_1, g_2 \in G$ such that $\varphi(g_1) = h_1$ and $\varphi(g_2) = h_2$. Now we have $$h_1 h_2 = \varphi(g_1) \varphi(g_2) = \varphi(g_1 g_2) = \varphi(g_2 g_1) = \varphi(g_2) \varphi(g_1) = h_2 h_1.$$ Thus $h_1$ and $h_2$ commute; since $h_1, h_2 \in H$ were arbitrary, $H$ is abelian.
($\Leftarrow$) Suppose $H$ is abelian, and let $g_1, g_2 \in G$. Then we have $$\varphi(g_1 g_2) = \varphi(g_1) \varphi(g_2) = \varphi(g_2) \varphi(g_1) = \varphi(g_2 g_1).$$ Since $\varphi$ is injective, we have $g_1 g_2 = g_2 g_1$. Since $g_1, g_2 \in G$ were arbitrary, $G$ is abelian.
Note that in the proof of ($\Rightarrow$) above, we only needed to use the surjectivity of $\varphi$. So in fact the image of any surjective group homomorphism from an abelian group is abelian. Similarly, in the proof of ($\Leftarrow$) above we only used injectivity; thus the source of any injective group homomorphism to an abelian group is abelian.