Assume there exist $2$ natural numbers that are coprime ($m$ and $n$ such that $(m,n)=1$) such that for each $g$, $h \in G$ we have $g^m h^m = h^m g^m$ and $g^n h^n = h^n g^n$. Then $G$ is abelian group. (That means $ab=ba$.)
Hint: $(m,n)=1$ then there exist $c,d\in\mathbb{Z}$ s.t. $cm+dn=1$. thus $$gh = g^{cm+dn} h^{cm+dn} = g^{cm} g^{dn} h^{cm} h^{dn} = (g^m)^c (g^n)^d (h^m)^c (h^n)^d = (g^n)^d (g^m)^c (h^m)^c (h^n)^d$$ Use property in hypothesis to reach $gh=hg$.
Please help me to continue.