Prove that $G$ is abelian

Given $a,b\in G$, consider the three elements $a,b$, and $a^{-1}b^{-1}$. If $a$ and $b$ don’t commute, then $a^{-1}b^{-1}$ commutes with at least one of $a$ and $b$. Say it commutes with $b$: then $$aba^{-1}b^{-1}=aa^{-1}b^{-1}b=1_G\;,$$ and $a$ and $b$ commute. If instead $a^{-1}b^{-1}$ commutes with $a$, $$a^{-1}b^{-1}ab=aa^{-1}b^{-1}b=1_G\;,$$ and again $a$ commutes with $b$.

Added: As Steve D points out, $a^{-1}b^{-1}$ may be equal to one of $a$ and $b$, in which case I don’t actually have three elements of $G$. If $a^{-1}b^{-1}=a$, then $b=a^{-2}$, which certainly commutes with $a$, and the argument is similar if $a^{-1}b^{-1}=b$.


Suppose there are $a,b$ that don't commute, and denote the centralizer of $x$ as $C(x)$.

The hypothesis says that $G=C(a)\cup C(b)$. But a group can't be the union of two proper subgroups, so one of these, say $C(a)$, equals $G$.

But then $a$ is central and commutes with $b$, a contradiction. Thus $G$ is abelian.