If $G$ is a group and $[G:Z(G)]=4$, show that $G/Z(G)$ is isomorphic to $\mathbb{Z}_2 \times \mathbb{Z}_2$

I want to show that if $G$ is a group and $[G:Z(G)]=4$, then $G/Z(G)$ is isomorphic to $\mathbb{Z}_2 \times \mathbb{Z}_2$.

I know I can do this by showing that $|G/Z(G)|=4$. For then $G/Z(G)$ is isomorphic to either $\mathbb{Z}_4$ or $\mathbb{Z}_2 \times \mathbb{Z}_2$. The former group is cyclic, so then $G/Z(G)$ would have to be cyclic. But if $G/Z(G)$ is cyclic, then $G$ is abelian, whence $Z(G)=G$, whence $[G:Z(G)]=1\neq4$. Therefore, $G/Z(G)$ must be isomorphic to $\mathbb{Z}_2 \times \mathbb{Z}_2$. Any suggestions on how to show that $|G/Z(G)|=4$?


I am guessing that you mean you wish to prove that $G/Z(G) \cong \mathbb{Z}_2 \times \mathbb{Z}_2$, because otherwise your statement implies that $|G| = 16$.

Assuming this, begin by showing that if $G/Z(G)$ is cyclic, then the group $G$ must be abelian. Hence, since there is only one non-cyclic group of order $4$, the result follows immediately.