Showing if $G$ is a group then the centralizer of an element is a subgroup Given: Let $G$ be an arbitrary group, and let $a\in G$. The centralizer of $a$ is defined as
$$C(a)=\{x\in G: xa=ax\}.$$
Question: Show that if $G$ is a group and $a\in G$, then $C(a)$ is a subgroup of $G$.
My work: Suppose $a$ has the identity element. Then let $xa=ax$ and $e$ be the identity element such that , $xea = xae = xa = ax$. Since we now know that both have the same identity element, and $C(a)$ is an element of $G$, it tells us that it gives the same identity element 
Could anyone verify this for me please? if it is wrong, then could you correct it please?
Thank you
 A: To show the set $C(a)$ is a group, it needs to be non-empty and satisfy $x,y\in C(a)\implies xy^{-1}\in C(a)$.
Firstly, $e\in C(a)$ because, by definition things in $C(a)$ are things that commute with $a$, i.e. $x\in G$ such that $ax=xa$. The identity, again by definition satisfies $ae=ea$, so $e\in C(a)$, and so it is non-empty.
Edit: in case you cannot see the proof all at once as in my original version, here is a more basic/less slick way. The slick proof is included at the end for completeness and those interested.
If $x,y\in C(a)$ then
$$xya=x(ya)$$
$$=x(ay)$$
since $ya=ay$
$$=(xa)y$$
by associativity
$$=axy$$
because $ax=xa$
hence $C(a)$ is closed under the group operation.
If $x\in C(a)$ then
$$ax^{-1}=x^{-1}xax^{-1}$$
since $xx^{-1}=e$
$$=x^{-1}axx^{-1}$$
since $ax=xa$
$$=x^{-1}a$$
since $x^{-1}x=e$
showing closure under inverses. Hence $xy^{-1}\in C(a)$ by definition of the set $C(a)$, so $C(a)$ is a subgroup.

For those interested in the original approach:
Let $x,y\in C(a)$ which we have already established is non-empty. Then
$$ayx^{-1}=yx^{-1}x(y^{-1}ay)x^{-1}$$
because $yx^{-1}=(xy^{-1})^{-1}$
$$=yx^{-1}x(y^{-1}ya)x^{-1}=yx^{-1}(xax^{-1})$$
since $ay=ya$ and $yy^{-1}=e$
$$=yx^{-1}a$$
since $ax=xa$ and $xx^{-1}=e$
hence
$$yx^{-1}a=ayx^{-1}$$
and we have shown $xy\in C(a)\implies yx^{-1}\in C(a)$ and again we have a subgroup.
So $C(a)$ again is a group by the same criterion.
A: To show $C(a)$ is a subgroup, you need to show


*

*$C(a)$ contains the identity (of $G$)

*The inverse of any element in $C(a)$ is in $C(a)$

*The product of two elements in $C(a)$ is in $C(a)$


$C(a)$ is the set of all elements in $G$ that commute with $a$. Does the identity element commute with $a$?
If $g \in C(a)$, then $ga=ag$. To show $g^{-1}a=ag^{-1}$, see what happens when you multiply $g^{-1}a$ on the right by $e=gg^{-1}$.
If $g,h \in C(a)$, then $ga=ag$ and $ha=ah$. You want to show $(gh)a=a(gh)$. This follows immediately if you use what you know about $g$ and $h$.
