Problem in solving a related to centre of a group. Let $G$ be a group of order $8$ and $x$ be an element of $G$ then $x^2 \in Z(G)$,the centre of the group $G$.
My work :
If there exists an element of $G$ of order $8$ then $G$ is cyclic and hence commutative.So,$Z(G) = G$ and this proves the result.If there exists no element of $G$ of order $8$ then all the elements are of order $1$,$2$ or $4$.Now since $x$ is of order $4$,the order of $x^2$ and $x^3$ are $2$ and $4$ respectively.Also since $G$ is a group of even order it must contain an odd number of elements of order $2$.Let this number be denoted by $n$.If $n = 1$ then $x^2$ is the only element in $G$ of order $2$. But order of $gx^2 g^{-1}$ and $x^2$ are same for all $g \in G$. Hence, $gx^2 = x^2 g$, for all $g \in G$.Which proves the result.If $n = 5$ then clearly $x^2$ commutes with every element of $G$ but when $n = 3$ then it can be easily shown that $x^2$ commutes with all the elements of order $\leq 2$. But I find difficulty when I try to show $x^2$ commutes with remaining two elements of order $4$.Please help me. Thank you in advance.
 A: The inner automorphism group $\text{Inn}(G)$ of $G$ consists of group automorphisms of the form $g\mapsto xgx^{-1}$ (known as the conjugation by $x\in G$).  It is easily seen that $\text{Inn}(G)\cong G/Z(G)$.  As psj36 has noted, if $G/Z(G)$ is cyclic, then $G$ is abelian.  However, the claim is trivial when $G$ is abelian.  Hence, we only need to check when $G$ is non-abelian.  As $G$ is a $p$-group (i.e., with $p=2$), $Z(G)$ is nontrivial.  Therefore, $\text{Inn}(G)\cong G/Z(G)$ must have order $4$.  The only noncyclic group of order $4$ is $C_2\times C_2$, where $C_k$ is the cyclic group of order $k$.  Therefore, [...].  You fill in the blank.
A: Let $G$ be a group of order $8$. 
Then $Z(G) > 1$ since $G$ is a $2$-group. So $|Z(G)| = 2, 4,$ or $8$ and $G/Z(G)$ has order $4, 2,$ or $1$. If $|G/Z(G)|$ has order $1$ or $2$, or is cyclic of order $4$, then $G$ is abelian and so $g^2 \in G = Z(G)$ for any $g \in G$. (As noted above, one should verify the result: If $G/Z(G)$ is cyclic, then $G$ is abelian.) 
The remaining case is when $G/Z(G) \cong C_2 \times C_2$; in this case every element of $G/Z(G)$ has order $2$, so for any $g \in G$ $$g^2Z(G) = [gZ(G)]^2 = Z(G)$$ which implies $g^2 \in Z(G)$.
A: If $G$ is commutative then the problem is done.So let us first assume that $G$ is not commutative.Then according to Jackson Hsu $|G/Z(G)|=4$.So $|Z(G)|=2$.Let $K=Z(G)$.Then $H \cap K$={$e_G$} or $K$.If the intersection contains only the identity then $|HK|=8$ i.e. $HK=G$.So $G$ becomes an internal direct product of $H$ and $K$.Hence $G \cong H \times K$.But since $H$ and $K$ are both commutative,then so is $G$,which is a contradiction.Hence the intersection becomes $K$.But $x^2 \in H$ is the only element of order $2$.Hence $x^2 \in K=Z(G)$.This completes the proof.
A: If $G$ is commutative then the problem is done.So let us first assume that $G$ is not commutative.Then according to Jackson Hsu $|G/Z(G)|=4$.So $|Z(G)|=2$.Let $K=Z(G)$.Let $H$ be the subgroup of $G$ generated by the element $x$.Then $H \cap K = \{e_G\}$ or $K$.If the intersection contains only the identity then $|HK|=8$ i.e. $HK=G$.So $G$ becomes an internal direct product of $H$ and $K$.Hence $G \cong H \times K$.But since $H$ and $K$ are both commutative,then so is $G$,which is a contradiction.Hence the intersection becomes $K$.But $x^2 \in H$ is the only element of order $2$.Hence $x^2 \in K=Z(G)$.This completes the proof.
