$G/Z$ cannot be isomorphic to quaternion group

Let $Q_8$ be the quaternion group. Show that $G/Z$ can never be isomorphic to $Q_8$, where $Z$ is the center of $G$.

Hint: if $G/Z\cong Q_8$, show that $G$ has two abelian subgroups of index $2$.

I'm trying to prove the hint by looking at the canonical homomorphism $\pi:G\rightarrow G/Z$. Well, $Q_8$ has some abelian subgroups of index $2$, such as $H=\{1,-1,i,-i\}$, but that doesn't seem to map to abelian subgroups of index $2$ of $G$. (We know that $\pi(ab)=\pi(a)\pi(b)=\pi(b)\pi(a)=\pi(ba)$ for $a,b$ in $\pi^{-1}(H)$, but that only yields $aba^{-1}b^{-1}\in Z$, not $aba^{-1}b^{-1}=1$.)

$Q_8$ has cyclic subgroups of index $2$, such as $\langle i\rangle$ and $\langle j\rangle$. Their inverse images in $G$ are of index $2$ and their respective centres contains at least the centre $Z$ of $G$. Hence their quotient by their centre is cyclic and finally $\pi^{-1}(\langle i\rangle)$ and $\pi^{-1}(\langle j\rangle)$ are abelian (cf. Jykri Lahtonen's comment). Select $g\in G$ with $\pi(g)=-1$. Then $g\in \pi^{-1}(\langle i\rangle)\cap \pi^{-1}(\langle j\rangle)$, hence it commutes with all elements of $\pi^{-1}(\langle i\rangle)$ and all elements of $\pi^{-1}(\langle j\rangle)$, therefore also with all elements of $\pi^{-1}(\langle i,j\rangle)=\pi^{-1}(Q_8)=G$, contradicting $g\notin Z$.
• So the center $Z(K)$ of $K = \langle i\rangle$ contains $Z(G)$, but it could be the case that the containment is strict. What guarantees that $K/Z(K)$ is cyclic? – Paul S. May 26 '13 at 20:26
• Oh, is it because if the containment is strict, then $|K/Z(K)| < |K/Z(G)| = 4$, and so $|K/Z(K)|=1,2,3$, and all possible groups must be cyclic? – Paul S. May 26 '13 at 20:27
• Yes, that should work, but does it also work in general (i.e. not depending on $|K/Z(G)|=4$)? – Paul S. May 26 '13 at 20:37