Prove a set is a subgroup Let $G$ be an abelian group. Let $H = \{x \in G: x = y^2 \text { for some } y \in G\}$. Prove that $H$ is a subgroup of $G$.

Let $x, y \in H.$ Then, $xy = y^2z^2 = yyzz.$ Since $H$ is abelian $yyzz = yzyz = (yz)^2.$ So, $xy \in H.$ 
Since $e = e^2, e \in H.$ 
$x^{-1} = (y^2)^{-1} = (y^{-1})^2.$
So, $H$ is a subgroup of $G$.
Please, check if it works.

I think you have the right idea but you're reusing variables.
It should have been something like:


*

*Let $x, y \in H$, then $x = s^2$, $y = t^2$ for some $s, t \in G$. Then $xy = s^2t^2 = (st)(st) = (st)^2$ (by commutativity of $G$) which means $xy \in H$.

*$e \in H$ since $e = e^2$.

*Let $x \in H$, then $x = s^2$ for some $s \in G$. $x^{-1} = (s^2)^{-1} = s^{-2} = (s^{-1})^2$ and hence $x^{-1} \in H$.


So now you can conclude, by definition, that $H$ is a subgroup of $G$.
Also, you should probably have a lemma or two showing that you can even do the exponent arithmetic as we did above.
