By the center of a group $G$ we mean the set of all elements of $G$ which commute with every element of $G$, that is, $C = \{ a \in G: ax = xa \text{ for every } x \in G \}$.
We want to show that $C$ is a subgroup:
(i). Let $m, n \in C$, then $mx = xm$ and $nx = xn$ for every $x \in G$. Show that $(mn)x = x(mn)$. $mx = xm \rightarrow x = m^{-1}xm$ and $nx = xn \rightarrow x = n^{-1}xn$. Then substitute: $mnx = (mn)x = (mn)(n^{-1}xn) = mxn = m(m^{-1}xm)n = x(mn) = xmn$.
(ii). Let $m \in C$, then $mx = xm$. Show that $m^{-1}x = xm^{-1}$. From $mx = xm$ we can conclude that $x = mxm^{-1}$ and $x = m^{-1}xm$. So I need to show that $m^{-1}x = xm^{-1}$. We can substitute as follows: $m^{-1}x = m^{-1}(mxm^{-1}) = xm^{-1}$.
After solving the previous problem, I am having trouble making any progress on the following problem:
Let $C' = \{ a \in G: (ax)^{2} = (xa)^{2} \text{ for every } x \in G \}$. Prove that $C'$ is a subgroup of $G$.
(i). Let $m, n \in C'$, then $(mx)^{2} = (xm)^{2}$ and $(nx)^{2} = (xn)^{2}$. Show that $(mnx)^{2} = (xmn)^{2}$.
(ii). Let $m \in C'$, show that $m^{-1} \in C'$.
I've tried used a similar strategy to the center problem by solving for $x$ and multiplying $(mx)^{2}, (xm)^{2}, (nx)^{2}, (xn)^{2}$ in different ways. But I haven't made any progress. Could I get a hint for part (i)?