Centralizer of a Subgroup is a Subgroup If $H$ is a subgroup of $G$, then Gallian defines the centralizer $C(H)$ of $H$ as the set $$C(H) = \{g \in G : \text{$g h = h g$ for all $h \in H $}\} \,.$$
It’s easy to show that $C(H)$ is a subgroup of $G$:

*

*Clearly $e h = h e = h$ for all $h \in H$, so $C(H)$ is nonempty.


*Then if $g_0 \in C(H)$ and $g_1 \in C(H)$, then $$(g_0 g_1) h = g_0 (g_1 h) = g_0 (h g_1) = (g_0 h) g_1 = h(g_0 g_1)$$
for all $h\in H$, so $g_0g_1\in C(H)$.


*Similarly, $$g_0 \in C(H) \iff g_0 h = h g_0 \iff g_0^{-1} (g_0 h) g_0^{-1} = g_0^{-1} (h g_0) g_0^{-1} \iff h g_0^{-1} = g_0^{-1} h$$
for all $h\in H$, so we have $g_0^{-1}\in C(H)$.
Thus $C(H)$ is a subgroup of $G$.
I have two concerns about this proof.
First, it is the exact same proof as for showing $C(h)$ is a subgroup of $G$ for any fixed $h \in G$, except for adding the two “for all $h \in H$” clauses after each closure argument. Is anything else needed?
Second, where does the condition that $H$ is a subgroup come into play? It seems one could take $H$ to be any subset of the group, not necessarily a subgroup.
Thanks in advance!
 A: For your first question: Yes, it is basically the same proof as for showing that $C_G(h)$ is a subgroup for given $h \in G$.
For your second question: Nothing about the fact that $H$ is a subgroup is used. So the same proof shows that $C_G(S)$ is a subgroup of $G$, for any subset $S$ of $G$.
By the way, if you know that centralizers of elements are subgroups, you could also notice that $$C_G(H) = \bigcap_{h \in H} C_G(h).$$ so $C_G(H)$ is a subgroup, since the intersection of any family of subgroups is a subgroup.
A: You are correct $C(X)$ is a subgroup for any $X \subseteq G$.
$C(X) = \{g \in G: gx = xg, \forall x \in X\}$.
Now define $I(X) = \{m \in G : mx = xm,  \forall x \in C(X) \}$
$X \subseteq I(X)$ but $I(X)$ is a subgroup. Infact $C(C(X)) = I(X)$. so its natural to expect that $X = I(X) = C(C(X))$. A necessary condition for this relation to hold is the fact $X$ is a subgroup. Now you get the idea on why people consider $X$ is a subgroup. Probably because anyway $I(X) = C(C(X))$ is a subgroup containing $X$.
