suppose g is an element of G not in H (any such g is of order 2). since gH ≠ H; for any h in H, gh is not in H, hence has order 2. thus:

ghgh = e, whence

ghg = h^-1, so that

ghg^-1 = ghg = h^-1, for all h in H.

now suppose h,k are any two elements of H.

hk = (gh^-1g)(gk^-1g) = g(h^-1)(gg)(k^-1)g = g(h^-1k^-1)g = g(kh)^-1g = kh,

so H is abelian.