Is it true that $\{a^2\mid a\in G\}=H$ (no not $\subseteq$) if subgroup $H$ has index $2$? An exercise asked me to prove that $a^2\in H$ for each $a\in G$ if $H$ is a subgroup of $G$ with index $2$.
I managed to prove that: 
If $a\in H$ then $a^2\in H$ and if $a\notin H$ then $a\in a^{-1}H$ so that $a^2=aa^{-1}h=h$ for some $h\in H$.
So we have $\{a^2\mid a\in G\}\subseteq H$ and the question rose:

Can it be proved that more strongly we have $\{a^2\mid a\in G\}=H$? 

I suspect that the answer is "no", but examination of $A_4\leq S_4$ did not lead to a counterexample.
My second question is:

If it is not true then are there nice extra conditions under wich it is true?


edit (this question is not a duplicate):
I am not asking for a proof that $a^2\in H$ for each $a\in G$ if $H$ is a subgroup of $G$ with index $2$
On the contrary. In my question I even give a proof of that myself 
 A: It is not true. For example, you can take $G=\mathbb{Z}/\mathbb{2Z}\times \mathbb{Z}/\mathbb{2Z}$ and $H=\mathbb{Z}/\mathbb{2Z}\times \{0\}$. Certainly $H$ has index $2$, but every element squared is the unit $(\bar0,\bar0)$, so
$$\{a^2|a\in G\}=\{(\bar0,\bar0)\}\neq H.$$
Another example is $G=(\mathbb{Q}_0,\cdot)$ and $H=\mathbb{Q}\cap (0,+\infty)$. This is a subgroup of index $2$, but not every positive rational is a square ($2$ is not, for example).
A: This is a partial answer in that it establishes, at least, a condition on $G$ and $H$ so that $\{a^2\mid a\in G\}=H$ holds.
Consider a finite group $G$. It has already been established in the problem statement that if $\{H, Hg\}$ are the cosets of $H$, then $Hg$ has no element which is a square of another element of $G$. All squares are in $H$.
Here it is assumed that $H$ is characteristic in $G$. Consider the subgroup $K$ which is generated by all squares. Then $K \subset H$. If $\phi$ is an automorphism of $G$, then $\phi$ not only fixes $H$, but it also fixes $K$ since $$\phi(a^2b^2)=\phi(a)^2\phi(b)^2.$$Thus $K$ is characteristic in $G$ as is $H$. Because $K\subset H \subset G$, we have as a well-known consequence of the homomorphism theorems $$\left[G: H\right]=\left[G/K: H/K\right]=2$$ where $H/K$ is the only subgroup of index $2$ in $G/K$ as $H$ is the only subgroup of index $2$ in $G$.
Now consider the group $G/K$. A general element of $G/K$ is $Kg$. It is easily seen that $(Kg)^2=K$. Whence $G/K$ is an abelian group all non-trivial  elements of which are of order $2$. Also $G/K$ is finite by initial assumption. The only such abelian group with a unique subgroup of index $2$ is the abstract group of order $2$ (https://math.stackexchange.com/a/1674704/54122).Thus, the order of $G/K$ is $2$ . It follows that $$H=K.$$
A: $\newcommand{\Size}[1]{\left\lvert #1 \right\rvert}$$\newcommand{\Span}[1]{\left\langle #1 \right\rangle}$I think I can give a simple-minded characterization of group for which the set of squares generates a subgroup if index $2$. I know this is not quite what you are looking for, but I hope it is useful.
Let $H = \Span{a^{2} : a \in G }$ have index $2$. Then clearly $G'\le H$. The property is inherited by $G/G'$, which must thus be of even order, with a cyclic Sylow $2$-subgroup.
Conversely, let $G$ be a group such that $G/G'$ has even order, with a cyclic Sylow $2$-subgroup $C$, and let $G/G' = D \times C$, where $D$ has odd order. Clearly $H$ contains $G'$, and the span of the squares in $G/G'$ is $D  C^{2}$.
Therefore the preimage in $G$ of $D C^{2}$ has index $2$ in $G$, and is exactly $H$.
