If $(ab)^3=a^3 b^3$, prove that the group $G$ is abelian. If in a group $G$, $(ab)^3=a^3 b^3$ for all $a,b\in G$, amd the $3$ does not divide $o(G)$, prove that $G$ is abelian.
I interpreted the fact that $3$ does not divide $o(G)$ as saying $(ab)^3\neq e$, where $e$ is the identity of the group. 
As for proving $ab=ba$, I did not get anywhere useful. I got the relation $(ba)^2=a^2 b^2$, but could not proceed beyond that. I got a lot of other relations too which I could not exploit- like $a^2 b^3=b^3 a^2$
A helpful hint instead of a solution would be great!
Thanks in advance!  

This is an attempt at an elementary and linear exposition of this proof strategy, since the original seemed to cause some confusion from a comment - and it uses the language of homomorphisms, which I have avoided.
First you need to establish that every element of the group is a cube. Since the group has order not divisible by 3, we know that if $x^3=e$ then $x=e$ (using $e$ for the identity).
Now suppose that $a^3=b^3$ - then we have $e=(a^3)(b^{-1})^3=(ab^{-1})^3$ so that $ab^{-1}=e$ whence $a=b$.
This means that no two cubes of different elements are equal. So if we cube all $n$ elements in the group we get $n$ different results. Hence every element of the group must be a cube.
Now consider $(aba^{-1})^3$ in two ways.
Writing it out in full and cancelling $aa^{-1}=e$ we get $ab^3a^{-1}$
Using the special relation we have for the group we get $(ab)^3(a^{-1})^3=a^3b^3(a^{-1})^3$
Setting these equal and cancelling: $b^3=a^2b^3(a^{-1})^2$ or $b^3a^2=a^2b^3$
Since $a$ and $b$ were completely arbitrary, every square commutes with every cube. But every element of the group is a cube, so every square commutes with everything.
Now we can write $ababab=(ab)^3=a^3b^3$ and when we cancel and use the fact that squares commute we find that $baba=a^2b^2=b^2a^2$ whence $ab=ba$.

Note that the fact that the group had order not divisible by $3$ was only used to prove that there were no elements of order $3$. The question might arise about infinite groups which have no elements or order $3$ and obey the relation given in the question.
The proof here does not go through, because a counting argument was used to show that every element in the group is a cube. This counting argument cannot be transposed to the infinite case. We can still prove that all the cubes of different elements are different and that every square commutes with every cube, but that is no longer enough to conclude the argument.
