Hint: Consider this presentation: $D_4=\langle x, y \mid x^4 = y^2 = (xy)^2 = 1 \rangle$.
It is enough to find the images of $x$ and $y$ under a homomorphism, as long as they satisfy the relations above. What are the possibilities when the codomain is $\mathbb Z_2\times\mathbb Z_2$ ?
For any group $G$, you have a bijection between $G$ and the set $Hom(\mathbb{Z},G)$ of group homomorphisms $\mathbb{Z}\to G$.
The bijection is as follows: for $x\in G$, set $h_x:\mathbb{Z}\to $G$, \ m\mapsto x^m$.
Then the desired bijection is $G\to Hom(\mathbb{Z},G), \ x\mapsto h_x.$
First of all, you have to check that $h_x$ is indeed a group homomorphism (easy).
For the injectivity part: if $x,y\in G$ are such that $h_x=h_y$, then $h_x(1)=h_y(1)$, that is $x=y$?
For the surjectivity part: the main idea is that any element of $\mathbb{Z}$ is the sum of several copies of $1$ (or $-1$). Thus, in order to define a homomorphism $\varphi: \mathbb{Z}\to G$, it is enough to know $\varphi(1)$.
More precisely, if $\varphi$ is such a morphism, then, for all $m\geq 0$, we have $\varphi(m)=\varphi(1+\cdots+1)=\varphi(1)^m$.
If $m<0$, then $\varphi(m)=\varphi(-(-m))=\varphi(-m)^{-1}$ (a morphism repects inverses), so $\varphi(m)=(\varphi(1)^{-m})^{-1}=\varphi(1)^m$.
Finally, $\varphi=h_x$ with $x=\varphi(1)$.
In particular, if $G=\mathbb{Z}_n$, you get $n$ such morphisms.
Concerning your second question, you have only the trivial group/ring morphism. Any element of $\mathbb{Z}_n$ has finite order. But a morphism sends an element of finite order to an element of finite order. Since the only element of $\mathbb{Q}$ of finite order is $0$....
Edit Some answers were given while I was typing. Feel free to delete this post if it seems useless.
Best Answer
Since $\mathbb{Z}_{20}$ is cyclic, a homomorphism $\phi$ is determined by where it sends a generator $x$. So there are $|\mathbb{Z}_8|=8$ total candidate homomorphisms. Which of these are valid?
Note that we must have $\phi(x)^{20}=1$ and $\phi(x)^8=1$.