If $H$ is a subgroup of a group $G$ and the index (number of right cosets) of $H$ is $2$, then $a^2 \in H$ for all $a\in G$.
My attempt: if $a\in H$ then $a^2\in H$ directly. If $a\notin H$ and $a^2\notin H$ then $a(a^{-1})^{-1} = a^2 \notin H$ then $G = Ha \cup Ha^{-1}$ (the union being disjoint). But $e\notin Ha$ because $e=a^{-1}a$ and $a^{-1}\notin H$. Also $e\notin Ha^{-1}$ because $e = aa^{-1}$ and $a\notin H$. Then we have a contradiction. So $a^2$ must be in $H$ in both cases.
I think it's ok but I dont feel the arguments with the identity $e$ are right and don't see how to justify them more rigorously.
Thanks in advance