TITLE: Problem from Herstein on group theory
QUESTION [21 upvotes]: The problem is:
If $G$ is a finite group with order not divisible by 3, and $(ab)^3=a^3b^3$ for all $a,b\in G$, then show that $G$ is abelian.
I have been trying this for a long time but not been able to make any progress. The only thing that I can think of is:
$$ab\cdot ab\cdot ab=aaa\cdot bbb\implies(ba)^2=a^2b^2=aabb=(\text{TPT})abba.$$
Now, how can I prove the last equality? If I write $aabb=abb^{-1}abb$, then in order for the hypothesis to be correct, $b^{-1}abb=ba\implies ab^2=b^2a$. Where am I going wrong? What should I do?

REPLY [11 votes]: The way, I am writing here, is from my old notes and personally I prefer the other approaches. But, maybe the given additional points below, inspire you for other problems like this problem.
We can prove that if for an integer $n$ and every $a,b\in G$, $(ab)^n=a^nb^n$, then $$(aba^{-1}b^{-1})^{n(n-1)}=e$$ The proof is easy. In fact, $$(aba^{-1}b^{-1})^{n^2}=[(aba^{-1}b^{-1})^n]^n=[a^n(ba^{-1}b^{-1})^n]^n=\cdots^*=a^nb^na^{-n}b^{-n}\\\ (aba^{-1}b^{-1})^{n}=(ab)^n(a^{-1}b^{-1})^n=a^nb^na^{-n}b^{-n}$$
*refer here for the missing steps
In your problem, we assume $G$ is not abelian, so there exist $a,b\in G, aba^{-1}b^{-1}\neq e$. According to the above lemma
$$(aba^{-1}b^{-1})^6=e$$
since we know $(ab)^3=a^3b^3$. So $|aba^{-1}b^{-1}|\big| 6$ and because of $3\nmid|G|$ so $|aba^{-1}b^{-1}|=2$. This means that $(aba^{-1}b^{-1})^2=e$. On the other hand, 
$$(ab)^3=a^3b^3\Longrightarrow (ba)^2=a^2b^2$$
(see @Haskell's answer) then $(a^{-1}b^{-1})^2(ab)^2=e$ or $(ab)^2=(ba)^2=a^2b^2$ or $ab=ba$. A nice contradiction!