Suppose $(xy)^2 = (yx)^2$. Then:

$xyxy = yxyx$

$xyx^{-1}y^{-1} = yx$

$xyx^{-1}y^{-1} = y^{-1}x^{-1}yx$, or in commutator notation:

$[x,y] = [y^{-1},x^{-1}]\dots(1)$. <--This is an equivalent re-formulation of the original condition.

Now, note that $[x,y]^{-1} = (xyx^{-1}y^{-1})^{-1} = yxy^{-1}x^{-1} = [y,x]\dots(2)$

Hence $[x,y] = [y^{-1},x^{-1}]$ by (1)

$ = [x^{-1},y^{-1}]^{-1}$ by (2),

$= [(y^{-1})^{-1},(x^{-1})^{-1}]$ by (1),

$ = [y,x] = [x,y]^{-1}$ by (2) again.

Since $G$ has no element of order 2, it must be that for every $x,y \in G$, we have $[x,y] = e$, that is: $xyx^{-1}y^{-1} = e$, so that $xy = yx$ and $G$ is abelian.