If $ab$ is an element of group $G$, are $a$ and $b$ both elements of group $G$ as well? Obviously, if $a$ and $b$ are elements of group $G$, then $ab$ is in $G$ as well.
Is the converse true?
I tried to think about it in terms of the inverse of the original statement (considering it's the contrapositive of the statement I'm trying to prove), but I wasn't sure how to prove that that was true (i.e. if one or both of the elements are not in $G$, then $ab$ is not in $G$).

Let $H$ be a subgroup of a group $G$ with the property that whenever $ab \in H$ for some $a,b \in G$, then $a \in H$ or $b \in H$. Then $H=G$. For suppose $H \subsetneq G$. Let $a \in G-H$. And put $b=a^{-1}$. Then $ab=1 \in H$, since $H$ is a subgroup. But then by the property, $a$ or $a^{-1}$ are elements of $H$, whence $a \in H$, contradicting the choice of $a$.
