"Let H be a non-empty subset of G. Then H contains some element. Let's call it g.

We are given that for any x, y ∈ H, xy⁻¹ ∈ H. (*)

First, we need to show that e ∈ H. Setting x = y = g in (*), we get gg⁻¹ = e is in H.

Next, we want to show that for any g ∈ H, g⁻¹ ∈ H. Indeed, if g is in H, then setting x = e and y = g in (*), we get eg⁻¹ = g⁻¹ is also in H.

Finally, let g, h be elements of H. We must show that their product is also in H. However, setting x = g and y = h⁻¹ in (*), we get g(h⁻¹)⁻¹ = gh is in H. Hence, H is indeed a subgroup of G.

Conversely, if g and h are in H, we want to show gh⁻¹ is in H. Since h is in H and H is a subgroup, its inverse h⁻¹ must also be in H. Because of the closure of the group operation, gh⁻¹ is in H."