Let $(G, \cdot)$ be a group and let $H \leq G$ (i.e. $H$ is a subgroup of $G$) such that $\mid G:H \mid = 1$ (i.e. the index of $H$ in $G$ is $1$). Does this imply that $G=H$?
In the case that $G$ is finite the conclusion is obvious, because we can use Lagrange's Theorem, namely $\mid G \mid = \mid H \mid \cdot \mid G:H \mid \implies \mid G \mid = \mid H \mid$. Since $H \leq G \implies H \subseteq G$ and $G$ is finite, we obtain that $G=H$, because they have the same cardinality.
The same reasoning will not work when $G$ is infinite, but will the conclusion remain true? I have looked up some similar questions such as this one, however I do not know the concept of a direct sum. It would be gladly appreciated if someone could briefly explain it or give a counterexample to my question.