Hello! This is my first post here, and I believe I checked all previous posts and could not find one like this.

The question states:

If H is a subgroup of G, then by the centralizer C(H) of H we mean the set {x in G | xh=hx for all h in H}. Prove that C(H) is a subgroup of G.

I have attempted to use the 1 step subgroup test:

1. C(H)={x in G | xh=hx for all h in H}.

2. e is in C(H) since he=eh for all h in H, so C(H) is not empty.

3. Assume a,b is in C(H).

4. Show ab^-1 is in C(H).

a in C(H) mean for all h in H, h is in G, ah=ha

b in C(H) mean for all h in H, h is in G, bh=hb

I get stuck here, obviously with the majority of the proof to go, the main issue is how do I prove that it is a subgroup of G and not simply that it is a subgroup of H? It makes sense that if it is a subgroup of H, which is a subgroup of G, that it is, but how do I proceed?

Thanks!