Assume H is an abelian group. Let K be a subset of H such that . We show that K is a subgroup of H. It suffices to show that whenever x and y are in K, then is also in K (link).

Since H is an abelian group, we have . Thus K is a subgroup of H.

Anyhow I don't think K is necessarily a subgroup of H if H is a non-abelian group. Take an example of .