A subgroup containing all the squares. Groups of order 8.  I can not solve the following two problems on Group Theory. 


*

*A subgroup $H$ of a group $G$ has the property that $x^2 \in H$ for every $x\in G$. Prove that $H$ is normal in $G$ and $G/H$ is abelian.

*Let $G$ be a group of order 8 and $x$ be an element of $G$. Prove that $x^2$ is in the center of $G$.  
 A: *

*If $H$ is normal, then the condition that $x^2\in H$ for all $x \in G$ means that $G/H$ is a group of exponent $2$ (every element satisfies $a^2 = 1$). It is a standard exercise that such a group is abelian (HINT: consider $(ab)^2$ and $a^2b^2$). 
So it is enough to show that if $x^2\in H$ for all $x\in G$, then $H$ is normal. Let $g\in G$, $h\in H$. We need to show that $ghg^{-1}\in H$. Since $ghgh = (gh)^2\in H$, then $ghgh = h'$ for some $h'\in H$, so $ghg = h'h^{-1}\in H$, hence $ghg^{-1} = (ghg)g^{-2}\in H$ (as both $ghg$ and $g^{-2} = (g^{-1})^2$ are in $H$). Therefore, for every $g\in G$ and $h\in H$, $ghg^{-1}\in H$, so $H$ is normal. 

*Well, the heavy-handed way of doing is to note that the groups of order $8$ are $C_8$, $C_4\times C_2$, $C_2\times C_2\times C_2$, $Q_8$ (the quaternion group of order $8$), and $D_8$ (the dihedral group of order $8$), and all of them have the desired property. Somehow I suspect this is not the intended answer...
Since $G$ is a $p$-group, its center is nontrivial. Consider $G/Z(G)$. It is a group of order $1$, $2$, or $4$. If it is of order $1$ or $2$, then for every $g\in G$ you have $g^2\in Z(G)$ (since $(gZ(G))^2$ is trivial in $G/Z(G)$). (In fact, it cannot be of order $2$, as noted below, but that doesn't matter here).
If it is of order $4$, then it is either isomorphic to the Klein $4$-group $C_2\times C_2$, or to the cyclic group of order $4$. But $G/Z(G)$ cannot be nontrivial cyclic for any group $G$, so if $|G/Z(G)|$ is of order $4$, then it is isomorphic to $C_2\times C_2$ and hence of exponent $2$. Again, we conclude that $(gZ(G))^2 = Z(G)$ for every $g\in G$, proving that $x^2\in Z(G)$ for all $x\in G$.
