Q:

Question about the center of a group

Show that $Z(G)$ is  subgroup of G. $Z(G)$ is the center of the group
Proof: First we show $Z(G)$ is a group being a subgroup
if $Z(G)$ is a group then
1) $1_G \in Z(G)$
2) $Z(G)$ is closed
3) if $a \in$ then $a^{-1}\in Z(G)$
1) $1_G*x=1_Gx$ $\forall x\in G$, so $1_G \in Z(G)$
2) Let $a,b \in Z(G)$, so $\forall$ $x \in G$ $ax=xa$ and $bx=xb$, how do you proceed from here?
3)if $a\in Z(G)$ then $ax=xa$ $\forall x \in G$ $$ax=xa$$  $$axa^{-1}=xaa^{-1}$$
$$axa^{-1}=x$$   $$a^{-1}axa^{-1}=a^{-1}x$$  $$xa^{-1}=a^{-1}x$$  so $a^{-1}\in Z(G)$
How does that look? I just

A:

Yes, just as Nex has mentioned:
For any $a,b\in Z(G)$ and $x\in G$, we know that $ax=xa$ and $bx=xb$. Using these with the fact that the multiplication is associative we see that for $ab$ we have $$(ab)x=a(bx)=a(xb)=(ax)b=(xa)b=x(ab).$$ Therefore $ab$ is also in the center.

