Prove a Group is Abelian if $(ab)^2=a^2b^2$

Problem 401

Proof.

To prove that $G$ is an abelian group, we need
\[ab=ba\]
for any elements $a, b$ in $G$.

By the given relation, we have
\[(ab)^2=a^2b^2.\]
The left hand side is
\[(ab)^2=(ab)(ab),\]
and thus the relation becomes
\[(ab)(ab)=a^2b^2.\]
Equivalently, we can express it as
\[abab=aabb.\]
Multiplying by $a^{-1}$ on the left and $b^{-1}$ on the right, we obtain
\begin{align*}
a^{-1}(abab)b^{-1}=a^{-1}(aabb)b^{-1}.
\end{align*}
Since $a^{-1}a=e, bb^{-1}=e$, where $e$ is the identity element of $G$, we have
\[ebae=eabe.\]
Since $e$ is the identity element, it yields that
\[ba=ab\]
and this implies that $G$ is an abelian group.

Related Question.

I wondered what happens if I change the number $2$ in $(ab)^2=a^2b^2$ into $3$, and created the following problem:

Problem. If $G$ is a group such that $(ab)^3=a^3b^3$ and $G$ does not have an element of order $3$, then $G$ is an abelian group.

More from my site

Eckmann–Hilton Argument: Group Operation is a Group Homomorphism
Let $G$ be a group with the identity element $e$ and suppose that we have a group homomorphism $\phi$ from the direct product $G \times G$ to $G$ satisfying
\[\phi(e, g)=g \text{ and } \phi(g, e)=g, \tag{*}\]
for any $g\in G$.
Let $\mu: G\times G \to G$ be a map defined […]

If a Group $G$ Satisfies $abc=cba$ then $G$ is an Abelian Group
Let $G$ be a group with identity element $e$.
Suppose that for any non identity elements $a, b, c$ of $G$ we have
\[abc=cba. \tag{*}\]
Then prove that $G$ is an abelian group.
Proof.
To show that $G$ is an abelian group we need to show that
\[ab=ba\]
for any […]

Quotient Group of Abelian Group is Abelian
Let $G$ be an abelian group and let $N$ be a normal subgroup of $G$.
Then prove that the quotient group $G/N$ is also an abelian group.
Proof.
Each element of $G/N$ is a coset $aN$ for some $a\in G$.
Let $aN, bN$ be arbitrary elements of $G/N$, where $a, b\in […]

Pullback Group of Two Group Homomorphisms into a Group
Let $G_1, G_1$, and $H$ be groups. Let $f_1: G_1 \to H$ and $f_2: G_2 \to H$ be group homomorphisms.
Define the subset $M$ of $G_1 \times G_2$ to be
\[M=\{(a_1, a_2) \in G_1\times G_2 \mid f_1(a_1)=f_2(a_2)\}.\]
Prove that $M$ is a subgroup of $G_1 \times G_2$.
[…]

A Group Homomorphism and an Abelian Group
Let $G$ be a group. Define a map $f:G \to G$ by sending each element $g \in G$ to its inverse $g^{-1} \in G$.
Show that $G$ is an abelian group if and only if the map $f: G\to G$ is a group homomorphism.
Proof.
$(\implies)$ If $G$ is an abelian group, then $f$ […]