Solution to Abstract Algebra by Dummit & Foote 3rd edition Chapter 2.2 Exercise 2.2.6
Let $G$ be a group and $H \leq G$.
(1) Show that $H \leq N_G(H)$. Give an example to show that this is not necessarily true of $H$ is not a subgroup.
(2) Show that $H \leq C_G(H)$ if and only if $H$ is abelian.
Solution:
(1) First we prove a lemma.
Lemma: Let $G$ be a group and let $H,K \leq G$. If $H \subseteq K$, then $H \leq K$.
Proof: Let $a,b \in H$. By the subgroup criterion (in $G$) we have $ab^{-1} \in H$. Thus by the subgroup criterion (in $K$), $H \leq K$. $\square$
Let $h \in H$. If $a \in H$, then $hah^{-1} \in H$ since $H$ is a subgroup of $G$. Thus $hHh^{-1} \subseteq H$. Moreover, note that if $a \in H$, we have $a = h(h^{-1}ah)h^{-1}$, so that $H \subseteq hHh^{-1}$. Thus $h \in N_G(H)$. So $H \subseteq N_G(H)$, and by the lemma we have $H \leq N_G(H)$.
Now consider $G = S_n$, $n \geq 3$, with $H = \{ (1\ 2), (1\ 2\ 3) \}$. We have $$(1\ 2)(1\ 2\ 3)(1\ 2) = (1\ 3\ 2),$$ so that $(1\ 2)H(1\ 2) \neq H$. Thus $(1\ 2) \notin N_G(H)$.
(2)
($\Rightarrow$) Let $a,b \in H$. Since $H \leq C_G(H)$, we have $aba^{-1} = b$, and thus $ab = ba$. So $H$ is abelian.
($\Leftarrow$) Let $a \in H$ and $b \in H$. Since $H$ is abelian, we have $ab = ba$, so that $aba^{-1} = b$. Thus $a \in C_G(H)$.