Each group of order 8 has a subgroup of order 2 and a subgroup of order 4. So, I was trying to prove the following theorem:

Let $G$ be a group of order $8$. So $G$ has a subgroup of order $2$ and a subgroup of order $4$.

First I proved that if a group has a finite even order, it has an element $g_0$ of order $2$. So $H=\{g_0,e\}$ is a group of order $2$. Now I'm trying to find the group of order $4$. By Lagrange theorem I can understand that:
$$|G|=|H|\cdot |G\,:\,H| \Rightarrow |G\,:\,H|=4$$
So we have $4$ Cosets. But how to continue from here? I feel like I miss the last one-two lines of the proof.
 A: Well, you can show that $G$ has a subgroup of order 4 directly. If $G$ has an element of order 4 or 8 then we are already done [why?]
Otherwise let $\pi$ and $\alpha$ be two distinct elements in $G$ of order 2. So $\pi = \pi^{-1}$ and $\alpha = \alpha^{-1}$. Then $\pi\alpha$ must have order 2 as well, lest there be an element of order 4 or 8 which would imply that we are done. This implies that $\pi \alpha = \alpha \pi$. [Indeed, for any elements $a,b,c$ in any group $G'$, if $ab=ac$ then $b$ must equal $c$. But  here $(\pi \alpha)(\pi \alpha) = 1$, while $(\pi \alpha)(\alpha \pi) = (\pi \alpha)(\alpha^{-1}\pi^{-1}) = 1$. So indeed, $\pi \alpha = \alpha \pi$.] This implies that $H \doteq \{1,\alpha, \pi, \pi\alpha \}$ is closed under composition, and as every element in $H$ has its inverse in $H$, it follows that $H$ is a subgroup, and has order 4.
A: If $G$ has no subgroup of order $4$, then every $g\ne e$ has order $2$. Then for any $g,h$,
$$
e=(gh)^2=ghgh=ghg^{-1}h^{-1},
$$i.e. $G$ is abelian. Then $\{e,g,h,gh\}$ would be a subgroup of order $4$.
A: Hint: No group has exactly two elements of order two.

 Assume no subgroup of order four exists. Apply Lagrange's Theorem. Apply the hint. See @Mike's answer.

Reference for the lemma that is the hint:
Exercise 4.61 of Gallian's "Contemporary Abstract Algebra (Eighth Edition)"
A: suppose non identity element  ${a\in G}$ and

*

*if ${|a|=8}$, then ${|a^4|=2}$


*if ${|a|=4}$ then ${|a^2|=2}$


*so, we found that there is an element k which has order 2. now the subgorup generated by another element h must have order 4 (according to Lagrange's Theorem)
