If $x^3, y^3$ commute for all $x, y\in G$, show that $H=\{h\in G|(|h|,3)=1\}$ is an abelian subgroup of $G$. What happens if $3\mapsto n\in\Bbb N$? If this question is too broad, then I'm sorry.
This appears to be new to MSE.
I'm reading "Contemporary Abstract Algebra," by Gallian.
This is Exercise 44 of the supplementary exercises for chapters 1-4 ibid. I'd like to answer this question using the tools available in the textbook so far. (A free copy of the textbook is available online.)
The Question:

Suppose $G$ is a group and $x^3y^3=y^3x^3$ for every $x$ and $y$ in $G$. Let $H=\{ x\mid \,\lvert x\rvert\text{ is relatively prime to }3\}$. Prove that elements of $H$ commute with each other and that $H$ is a subgroup of $G$. Is your argument valid if $3$ is replaced by an arbitrary positive integer $n$? Explain why or why not.

Thoughts:
In the textbook, I think $\lvert e\rvert:=1$. Thus $e\in H$.
I want to use the two-step subgroup lemma.
If $h\in H$, then $(\lvert h\rvert, 3)=1$. But it has been shown in the textbook previously (I think as an exercise) that for all $g\in G$ we have $\lvert g^{-1}\rvert=\lvert g\rvert$, so that $(\lvert h^{-1}\rvert, 3)=1$. Hence $h^{-1}\in H$.
The next step is to show that for any $h_1, h_2\in H$, we have $h_1h_2\in H$.
My problem is that I'm unsure of what the order of a product of elements is in terms of the orders of the elements in the product. For example, in the symmetric group $\mathcal{S}_3$, we have $\lvert (12)\rvert=2$ and $\lvert (13)\rvert=2$ but $\lvert (13)(12)\rvert=\lvert (123)\rvert=3$.
I gather that the coprimality is important and that if $n$ is not prime, $H$ might not be a subgroup; I'm not sure though. That is just a vague recollection of undergraduate algebra speaking . . .

How to prove $H$ is abelian, I don't know.

I'm aware that I haven't used the hypothesis that  $x^3y^3=y^3x^3$ for every $x$ and $y$ in $G$.

Please help :)
 A: We begin by noting that the hypothesis $x^3 y^3 = y^3 x^3$ can actually be strengthened to 
$$(x^3 y^3)^n = (x^3)^n (y^3)^n \text{ for all } x,y \in G \text{ and } n \in \mathbb{N}. \tag{$\star$}
$$
The stronger version can be proved by induction. 
Perhaps it is worth commenting on the inductive step.  If we assume that  $(x^3 y^3)^{n-1} = (x^3)^{n-1} (y^3)^{n-1}$, then we write
$$(x^3 y^3)^n = (x^3 y^3)^{n-1} (x^3 y^3)$$
and we repeatedly 
use the given hypothesis to move the last factor of $x^3$ across each of the $n-1$ interior copies of $y^3$ to give
$$
\begin{split}
(x^3 y^3)^n &=
 x^{3(n-1)} y^{3(n-2)} (y^3x^3) y^3 = x^{3(n-1)} y^{3(n-2)} (x^3 y^3) y^3 \\
&= x^{3(n-1)} y^{3(n-3)} (y^3 x^3) y^6 = \dots = x^{3n} y^{3n}.
\end{split}$$
In order to apply the hypothesis $x^3y^3 = y^3 x^3$ as well as the stronger analogue, we use the following lemma.
Lemma 1: If $\text{gcd}(|h|, 3) = 1$, then $h = g^3$ for some $g \in G$.  
Proof: If $\text{gcd}(|h|, 3) = 1$, then there exist $k, \ell \in \mathbb{Z}$ so that $1 = k|h| + 3 \ell$.  It follows that we have
$$
\begin{split}
h = h^1 = h^{k|h|} \cdot h^{3 \ell} = \left(h^{\ell}\right)^3.
& \\
& \square
\end{split}
$$
Having proved the lemma, one can prove that $H$ is closed under multiplication as follows: let $h_1, h_2 \in H$.  Then there are $g_1, g_2 \in G$ so that $h_1 = g_1^3$ and $h_2 = g_2^3$.  To prove that $h_1 h_2 \in H$, we must show that $\text{gcd}(|h_1 h_2|,3) = 1$.  For this, it suffices to show that 
$(h_1 h_2)^{|h_1| |h_2|} = 1$ because this will mean that $|h_1 h_2|$ divides the product of $|h_1|$ and $|h_2|$.  To  show that $(h_1 h_2)^{|h_1| |h_2|} = 1$, we use $(\star)$ to give
$$
(h_1 h_2)^{|h_1| |h_2|} = (g_1^3 g_2^3)^{|h_1| |h_2|} = (g_1^3)^{|h_1| |h_2|} (g_2^3)^{|h_1| |h_2|} = h_1^{|h_1| |h_2|} h_2^{|h_1| |h_2|} = 1. 
$$
This concludes our proof that $H$ is closed under multiplication.  
Having proved that $H$ is a subgroup, it is immediate that $H$ is abelian, because every element of $H$ is a cube in $G$, and we are given that cubes commute in $G$.

Edit: I forgot to address what happens if we replace $3$ by an arbitrary $n \in \mathbb{N}$.  If we replace $3$ by $n$, then the argument still works: we can still see that any $h \in G$ so that $(|h|, n) = 1$ must be a perfect $n$th power.  Using this, we can still show that if $h_1, h_2$ have 
$(|h_1|, n) = 1 = (|h_2|, n)$, then the order of $h_1 h_2$ divides the product of their orders, which means it is also coprime to $n$.
