So my challenge is:

> 
> Prove that if $Z(G) = \lbrace x \in G: gx = xg \text{ for all }g\in G\rbrace$ where $G$ is a group, then $Z(G)$ is a group
> 
> 
> 

Unlike this question: <https://math.stackexchange.com/questions/571214/to-show-that-the-center-is-a-subgroup>, I am not asking for a technique to prove this but a check of my proof, i.e. proof-verification.

For the identity, $e$ clearly is in $Z(G)$ and in $G$.

For the inversability, $$gx = xg \iff x^{-1}gx = g \iff x^{-1}gxx^{-1} = gx^{-1} \iff x^{-1}g = gx^{-1}$$

For the Closure, I am not so sure my proof is complete:
$$gx = xg \iff gxa = xga \iff g(xa) = x(ga) \iff g(xa) = x(ag) \iff g(xa) = (xa)g$$

Is my proof complete?

Thanks