A group such that $a^m b^m = b^m a^m$ and $a^n b^n = b^n a^n$ ($m$, $n$ coprime) is abelian? Let $(G,.)$ be a group and $m,n \in\mathbb Z$ such that $\gcd(m,n)=1$. Assume that
$$ \forall a,b \in G, \,a^mb^m=b^ma^m,$$
$$\forall a,b \in G, \, a^nb^n=b^na^n.$$

Then how prove $G$ is an abelian group?

Some context: Some of these commutation relations often imply that $G$ is abelian, for example if $(ab)^i = a^i b^i$ for three consecutive integers $i$ then $G$ is abelian, or if $g^2 = e$ for all $g$ then $G$ is abelian. This looks like another example of this phenomenon, but the same techniques do not apply.
Let $M \subset G$ be the subgroup generated by all $m$-th powers and let $N \subset G$ be the subgroup generated by all $n$-th powers. These subgroups are clearly abelian normal subgroups. Since $m$ and $n$ are coprime, $G = MN$, and hence $M \cap N$ is contained in the center $Z(G)$ of $G$. 
To prove that $G$ is abelian it suffices to show that $M$ and $N$ commute, that is $[M,N]=1$. Note that $[M,N] \subset M \cap N$ (since $M$ and $N$ are normal subgroups). Let $a \in M$ and $b \in N$.
Then $[a, b] = a^{−1}b^{−1}ab \in M \cap N$. Hence $[a, b] = z$ with $z \in Z(G)$. Hence $b^{−1}ab = za$, whence $b^{−1}a^nb=z^na^n$. Since $a^n \in N$ it commutes with $b$, so $z^n=1$. Similarly $z^m=1$. Since $m$ and $n$ are relatively prime, we conclude $z=1$.
As $\gcd(m, n) = 1$, by Bezóut's identity there are $u$, $v$ such that $u m + v n = 1$.
Take $a, b \in G$ arbitrary. By the conditions, as $a^u \in G$ for all $u \in \mathbb{Z}$, and as the conditions allow to commute certain powers:
$$
\begin{align*}
a^{u m} b^{u m} &amp;= b^{u m} a^{u m} \\
(a^{u m} b^{u m})^{v n} &amp;= a^{u m + v n} b^{u m + v n} \\
                        &amp;= a b \\
(b^{u m} a^{u m})^{v n} &amp;= b^{u m + v n} a^{u m + v n} \\
                        &amp;= b a
\end{align*}
$$
This because, e.g.,
$(a^{u m} b^{u m})^2 = a^{u m} b^{u m} a^{u m} b^{u m}
                     = a^{u m} a^{u m} b^{u m} b^{u m}
                     = a^{2 u m} b^{2 u m},$
since the middle pair commutes by the conditions. Now use induction.
(Perhaps the switching around can be expressed in a more compact way).
Nice problem!