Why if $G_n$ is a subgroup of G then G is abelian? I found this exercise, that says:

Let $G$ be a group and let $G_n=\{g^n : g\in G\}$. Under what hypothesis about $G$ can we show that $G_n$ is a subgroup of $G$?

Apparently the answer is that G has to be abelian, but I don't see why.
Reference: Fraleigh p. 59 Question 5.56 in A First Course in Abstract Algebra
 A: If $G$ is abelian, then $G_n = \{ g^n : g \in G \}$ is closed under multiplication since $g^n \cdot h^n = (gh)^n$ by repeatedly commuting $g$s past $h$s. $G_n$ is always closed under inversion.
If $G$ is a group with the property that $g^n h^n = (gh)^n$ for all $g,h \in G$, then $G$ is called $n$-abelian. 2-abelian groups are abelian, but 3-abelian groups need not be abelian.
Furthermore, $G_n$ may happen to be a subgroup even if $g^n h^n \neq (gh)^n$ as all that is required is that $g^n h^n = k^n$ for some $k \in G$. For instance if $G$ is dihedral of order 8, then $G_3 = G$ is a subgroup, but $G$ is not 3-abelian.
A: $\langle g \rangle$ is always a subgroup; it contains the identity element ($g^0 = e$) and is clearly closed under multiplication ($g^n g^m = g^{n+m}$). There are no conditions required on the group $G$.
Note that $\langle g \rangle$ is the standard notation for $\{g^n : n \in \Bbb Z\}$. Now if
$$G_n = \{g^n : g \in G\}$$
where $n$ is fixed, then $G_n$ is a subgroup if $G$ is abelian, but if $G$ is nonabelian it depends. For example, if $G = D_n$ is a dihedral group, then $G_2$ is a subgroup. On the other hand, if $G = A_4$, the alternating group on $4$ letters, then $G_2$ is not a subgroup.
