Problem in working out a question related to group theory. The question is :
Let $G$ be a finite group whose order is not divisible by $3$.Suppose that $(ab)^{3} = a^{3} b^{3}$ for all $a,\ b \in G$. Prove that $G$ must be abelian.
By the given condition it can be deduced that $(ba)^{2} = a^{2} b^{2}$ for all $a,\ b \in G$.But now how can proceed? Actually I think I have failed to do it because I have failed to use the condition that order of $G$ is not divisible by $3$. Please help me.
Thank you in advance.  
 A: We do this in several steps.


*

*Every square in $ G $ commutes with every cube, that is, for all $ a, b \in G $, we have $ a^3 b^2 = b^2 a^3 $. Indeed, since $ a^3 b^3 = (ab)^3 $, we have $ a^3 b^2 = ababa $; and $ b^3 a^3 = (ba)^3 $ implies $ b^2 a^3 = ababa $ as well.

*Since $ |G| $ is not divisible by $ 3 $, the map $ x \to x^3 $ is an endomorphism of $ G $ (by the given condition) with trivial kernel (since $ G $ cannot have any element of order $ 3 $.) Therefore, it is an injective map $ G \to G $, and by finiteness of $ G $ is it surjective. In other words, every element of $ G $ is the cube of some element. Since squares commute with cubes in $ G $, and every element is a cube, it follows that squares lie in the center of $ G $.

*Now, let $ a, b \in G $ be arbitrary. Then, the above point implies $ a^2 b^2 = b^2 a^2 $, and we may write $ (ab)^3 = a^3 b^3 = a b^2 a^2 b $, from which it follows that $ ab = ba $ upon cancellation. Therefore, $ G $ is abelian.

A: Since the order of $G$ is not a multiple of $3$, no element of $G$ has order $3$.

Let $f \colon G \rightarrow G$ be defined by $f(x) = x^3$.

Claim $f$ is injective.

Then
\begin{align*}
&f(x) = f(y)\\[4pt]
\implies\; &x^3=y^3\\[4pt]
\implies\; &x^3y^{-3}=1\\[4pt]
\implies\; &(xy^{-1})^3=1&&\text{[applying the hypothesis]}\\[4pt]
\implies\; &xy^{-1}=1&&\text{[since no element of $G$ has order $3$]}\\[4pt]
\implies\; &x = y
\end{align*}
so $f$ is injective, as claimed.

As you've already shown,
$$(ba)^2 = a^2b^2,\;\text{for all}\;a,b \in G
\qquad (1) \qquad\qquad\;\;\;$$
Let $a,b \in G$. Then
\begin{align*}
(ba)^4 &= ((ba)^2)^2&&
\qquad\qquad\qquad\qquad\qquad\;\;\;\;
\\[4pt]
&=(a^2b^2)^2&&
\;\;
\text{[by $(1)$]}
\\[4pt]
&=b^4a^4&&
\;\;
\text{[by $(1)$]}
\end{align*}
But then
\begin{align*}
& (ba)^4 = b^4a^4\\[4pt]
\implies\; &(ba)(ba)(ba)(ba) = b^4a^4\\[4pt]
\implies\; &b(ab)^3a = b^4a^4\\[4pt]
\implies\; &(ab)^3 = b^3a^3\\[4pt]
\implies\; &(ab)^3 = (ba)^3\qquad\text{[applying the hypothesis]}\\[4pt]
\implies\; &f(ab) = f(ba)\\[4pt]
\implies\; &ab = ba
\end{align*}
Hence $G$ is commutative, as was to be shown.
More generally, if $G$ is any group (not necessarily finite) such that 


*

*$(ab)^3=a^3b^3$ for all $a,b \in G$.

*No element of $G$ has order $3$.


then the proof goes through in the same way.
A: There is no need of introducing the concept of homomorphism here.
Since order of $G$ is not divisible by $3$ so if $a^{3} = e$ for some $a \in G$ we should have $a = e$.
Now we claim that every element of $G$ is the form of a cube.In fact if $a^{3} = b^{3}$, for some $a,b \in G$.Then we would have $a^{3} (b^{-1})^{3} = e$ $\implies (ab^{-1})^3 = e$ i.e. $a = b$.So if $a,b \in G$ with $a \neq b$ then we have $a^{3} \neq b^{3}$.This will ensure that every element of $G$ is the form of a cube.
Now we write down $(aba^{-1})^{3}$ in two ways :
(1) $ab^{3}a^{-1}$.
(2) $a^{3}b^{3} (a^{-1})^{3}$.
Setting (1) $=$ (2) we have
$b^{3} = a^{2} b^{3} (a^{-1})^{2}$ $\implies b^{3} a^{2} = a^{2} b^{3}$.Since $a$ and $b$ are completely arbitrary the above result shows that square of every element of $G$ commutes with every element of $G$.
Now the given condition simplifies to $(ba)^{2} = a^{2} b^{2} = b^{2} a^{2}$ (by the above result just proved).Now cancellation laws will easily lead us to the desired conclusion.
