What is the proof that if subsets $gH$ have no common elements then $H$ must be a subgroup? In proving Lagrange's Theorem we're usually first showing that cosets have no common elements. I'm looking for the proof that if subsets $gH$ have no common elements, then $H$ must be a subgroup.

Firstly, the claim is not true without assuming that $H$ contains the identity $e$, because any coset is a counter example.
Now let me prove:

Let $G$ be a group and $H\subseteq G$ be a subset containing the identity element $e$. Suppose that for any two elements $g, g'\in G$, either $gH = g'H$ or $gH \cap g'H = \emptyset$. Then $H$ is a subgroup of $G$.

Proof: Let $h$ be any element of $H$. We have $e = h^{-1}h = ee \in h^{-1}H \cap eH$, hence $h^{-1}H = eH = H$. In particular, the element $h^{-1}e = h^{-1}$ is in $H$.
On the other hand, we have $h = he = eh \in hH \cap eH$, hence $hH = eH = H$. Thus for any $h'\in H$, we have $hh' \in H$.
This shows that $H$ is a subgroup of $G$.
