if $ab = ba$ for all $a \in X$ and for all $b \in X$ then $\langle X \rangle$ is abelian subgroup of $G$ if $X \subseteq G$ such that $\forall a,b \in X$ we have $ab = ba$ then we should prove that $\langle X \rangle$ is an abelian subgroup of G.
its abviouse that $\langle X \rangle$ is subgroup of $G$. for proving abelian part we have that $X \subseteq C_G(X) \leq G$ there for $\langle X \rangle \subseteq C_G(X)$.
if we show $\langle X \rangle \subseteq C_G(\langle X \rangle)$ then $\forall g \in \langle X \rangle : g \in C_G(\langle X \rangle)\Rightarrow \forall g \in \langle X \rangle \quad \forall h \in \langle X \rangle : hg = gh$.
is this proof correct? and how can I show that $\langle X \rangle \subseteq C_G(X)$ then  $\langle X \rangle \subseteq C_G(\langle X \rangle)$ ?
 A: Order theoretic one-inch punch
The centralizer has the property that $Y\subseteq C_G(X)\iff X\subseteq C_G(Y)$. From $X\subseteq C_G(X)$ you get $\langle X\rangle\subseteq C_G(X)$, and from the property just mentioned you get $X\subseteq C_G(\langle X \rangle)$. It follows that $\langle X\rangle\subseteq C_G(\langle X \rangle)$, and that amounts to $\langle X\rangle$ being Abelian.
Order-theoretic judo chop
I think there are two things that can help you: 


*

*the centralizer map $C_G(-)$ is an order reversing map on nonempty subsets of $G$. That is, if $X\subseteq Y\subseteq G$, then $C_G(Y)\subseteq C_G(X)$; and 

*the centralizer map $C_G(-)$ is "extensive" in the sense that $C_G(C_G(X))\supseteq X$ for any nonempty subset $X$ of a group $G$ even outside the context of this problem.
Since you know the hypothesis gives you $X\subseteq C_G(X)$, by definition of $\langle X\rangle$ and the fact that the centralizer is a subgroup, you have that $$\langle X \rangle\subseteq C_G(X)$$
Applying the order-reversing property, we also have $$C_G(C_G(X))\subseteq C_G(\langle X\rangle)$$
By the first property I mentioned, 
$$X\subseteq C_G(C_G(X))\subseteq C_G(\langle X\rangle)$$
Again, by definition of $\langle X\rangle$, we can conclude that $$\langle X\rangle\subseteq C_G(\langle X\rangle)$$
This says that every element of the group centralizes the group, and so the group is abelian.
Group theoretic Haymaker punch
If you are more comfortable thinking of $\langle X\rangle$ as words made up of symbols from $X$ and their inverses, then you can also note that $\{x^{-1}\mid x\in X\}$ also centralizes $X$, and therefore all such words would have to commute with each other. This would probably involve induction on the length of words.
