Let $p$ be an odd prime Find all the subgroups of $D_{2p}$.
We know that all $g^i$ $(i=1,\dots,p-1)$ have order $p$ and all $g^ih$ $(i=0,\dots,p-1)$ has order $2$. By Lagrange if $H < G$ then $|H|<|G|$ so we have the possibilities $H=\{ e\}$, $|H|=2$, $|H|=p$.
For $|H|=p$ apparently $H$ must contain all elements of order $p$ (plus identity).
Why is this so?
By Lagrange's theorem, all subgroups must have order $1$, $2$, $p$, or $2p$.
Only the identity has order $1$.
By Sylow's theorems, the number of subgroups of order $p$ is $\equiv 1 \pmod{p}$, which implies only $1$.
There is clearly only one subgroup of order $2p$.
That leaves subgroups of order $2$. This is the number of reflectional symmetries of a p-gon, which is $p$.