If $G = S_5$ and $g = (1 2 3)$, what is the number of elements in $H = \{x \in G \ :\ xg = gx\}$? Where $H$ is a subgroup of $G$, how could I find $|H|$?
 A: A way that doesn't use group actions (which are awesome, by the way, so try to use them when you can):
We want to know the order of the centralizer of $g,\ |C(g)|$.
Now $x \in C(g)$ means that $xgx^{-1} = g$.
Since $x(1\ 2\ 3)x^{-1} = (x(1)\ x(2)\ x(3))$ we can immediately see two things:
$x$ must map $\{1,2,3\} \to \{1,2,3\}$ and thus $\{4,5\} \to \{4,5\}$.
In other words, $C(g)$ lies in a subgroup of $S_5$ isomorphic to $S_3 \times S_2$.
This alone tells us that $|C(g)| \leq 24$.
Let's write $g'$ for the restriction of $g$ to $S_3$.
Now, if $y \in S_3$ is a transposition, and $z \in S_2$ (acting on the $2$-element set $\{4,5\}$), then:
$(y,z)g(y,z)^{-1} = (y,z)(g',e)(y,z) = (yg'y,zz) = (yg'y,e)$
However, we know that no transposition commutes with $g'$ in $S_3$ (or else $S_3$ would be abelian, and thus cyclic). So we know that $yg'y \neq g'$. On the other hand, $g$ certainly commutes with powers of itself, that is, every $3$-cycle in $S_3 \times \{e\}$.
Thus $C(g)$ lies in a subgroup of $S_5$ isomorphic to $A_3 \times S_2 \cong \Bbb Z_6$.
Since it is easy to see that $\langle g,(4\ 5)\rangle$ is contained in $C(g)$, and that this group has $6$ elements, we conclude that $|C(g)| = 6$.
A: Let $G$ acts on itself by conjugation. Consider the orbit of $g$, it's the conjugacy class of $g$ in $S_{5}$, so the set of $3$ cycles. Now, $H$ is the stabilizer of $g$. If $x \in H$, then $xg=gx$ so $xgx^{-1}=g$. And if $x \in Stab(g)$, then $xgx^{-1}=g$ so $xg=gx$ so $x \in H$. Now the orbit stabilizer theorem tells us that $|G|=|Orb(g)||Stab(g)|$, so $|G|=$# of 3 cycles $\times |H|$. You can count $20$ 3 cycles, so $|H|=6$.
