Number of homomorphism from $Q_8/\Bbb{Z}(Q_8)$ to $D_4/\Bbb{Z}(D_4).$ Problem- Find the number of homomorphism from $Q_8/{Z}(Q_8)$ to $D_4/{Z}(D_4).$
Attempt-  Since $|Q_8/Z(Q_9)|=4$ and group of order $4$ is always abelian in this case $Q_4$ is not isomorphic to $\Bbb{Z}_4$ and any abelian group of order $4$  is isomorphic to $\Bbb{Z}_2×\Bbb{Z}_2$. Similarly $D_4/Z(D_4)≈\Bbb{Z}_2×\Bbb{Z}_2$.
Is answer $16$?
Please someone explain. Thanks in advance.
 A: Let's write $G:=\mathbb{Z_2}\times\mathbb{Z_2}=\{e,x,y,z\}$ when $e$ is the identity. Every element is the inverse of itself, $xy=z$, $xz=y$, $yz=x$ and the group is abelian. 
Now, I say a function $\varphi:G\to G$ is a homomorphism if and only if $\varphi(e)=e$ and $\varphi(x)\varphi(y)=\varphi(z)$. Let's prove it. If $\varphi$ is a homomorphism then it obviously satisfies these two properties. As for the other direction suppose $\varphi$ has the two properties. Every element is the inverse of itself so for any $g\in G$ we have $\varphi(g^2)=\varphi(e)=e$ and also $\varphi(g)\varphi(g)=e$ (because $\varphi(g)\in G$ as well) and hence $\varphi(g^2)=\varphi(g)\varphi(g)$. Also by multiplying the equation $\varphi(x)\varphi(y)=\varphi(z)$ by $\varphi(y)$ on both sides we get $\varphi(yz)=\varphi(x)=\varphi(y)\varphi(z)$ and in a similar way by multiplying $\varphi(x)\varphi(y)=\varphi(z)$ by $\varphi(x)$ we get $\varphi(xz)=\varphi(y)=\varphi(x)\varphi(z)$. And of course for all $g\in G$ we have $\varphi(ge)=\varphi(g)\varphi(e)$. So $\varphi$ is a homomorphism. 
So that way we get that we are free to choose the images of $x$ and $y$ but that's it. We can't choose the images of $e$ and $z$, they are dependent. We have $4$ options to choose the image of $x$, $4$ options to choose the image of $y$ so we conclude there are $16$ homomorphisms from $\mathbb{Z_2}\times\mathbb{Z_2}$ to itself. 
