if $H \leq G$ has index 2, then $a^2\in H$ for every $a\in G$
I am not sure that whether the way that i prove this statement is correct.
Since $[G:H]=2, \forall a\in G,G/H=\{H,Ha\}$
Hence $Ha^2=H \implies a^2\in H$
if $H \leq G$ has index 2, then $a^2\in H$ for every $a\in G$
I am not sure that whether the way that i prove this statement is correct.
Since $[G:H]=2, \forall a\in G,G/H=\{H,Ha\}$
Hence $Ha^2=H \implies a^2\in H$
Your idea is close, but the proof is not entirely correct as stated. Suppose $H$ has index $2$. Let $a\in G$. If $a\in H$, then $a^2\in H$ certainly. If $a\notin H$, then $G/H=\{H,aH\}$. Also, $H$ is normal, so $G/H$ is a group. Now $aH$ has order $2$ in $G/H$, so $$ H=(aH)^2=a^2H, $$ and thus $a^2\in H$.
Note $aH = bH \iff b^{-1}a \in H$. As others have remarked above, if $a \in H$, then certainly $a^2 \in H$, and in this case $a^2H = H$ (since $a^2 = e^{-1}a^2 \in H$).
If $a \not \in H$, we have only two choices for $a^2H$: either $H$, or $aH$. Suppose we somehow had:
$a^2H = aH$.
This implies that $a^{-1}a^2\in H$, that is: $a \in H$, a contradiction.
If $a\in H$ then evidently $a^2\in H$.
If $a\notin H$ then also $a^{-1}\notin H$ and the fact that $H$ has index $2$ then tells us that $a\in G\setminus H=a^{-1}H$.
So $a=a^{-1}h$ for some $h\in H$ and consequently $a^2=aa^{-1}h=h\in H$.