Counting homomorphisms between $\Bbb Z$ and $\Bbb Z_n$ and also between $\Bbb Z_n$ and $\Bbb Q$ Recently, I have tried to find out how many group homomorphisms exist from $\Bbb Z$ to  $\Bbb Z_n$ . 
My argument goes like this: (in the following, $\tau$ and $\phi$ denote the well-known number theoretic functions)
Let, $\psi$ be such a homomorphism. Since $\Bbb Z$ is cyclic, hence $\psi{(\Bbb Z)}$ must be a cyclic subgroup of $\Bbb Z_n$ with the generator $\psi{(1)}$ . Using properties of Cyclic groups, we obtain that $| \psi{(\Bbb Z)}|$ can be any positive integer m such that $ m | n$ , hence there are in total $\tau (n)$ number of possibilities for  $| \psi{(\Bbb Z)}|$ and hence for $ o(\psi(1))$. 
Let S denote the set of all positive integer divisors of n, i.e. $$ S = \{d \in {\Bbb Z}^+ : d | n \}$$ , then |S| =  $\tau(n)$ .
Again, since $\psi{(\Bbb Z)}$ is cyclic it follows that for each $d \in S$, we have $\phi(d)$ number of possible distinct images.
Since for each such image (for each divisor) it defines a homomorphism, the required number of homomorphisms are :
$$\sum_{d|n} \phi(d) = n$$
and among these n homomorphisms , there are precisely $\phi(n)$ number of epimorphisms.
Conversely, from $\Bbb Z_n$ to $\Bbb Z$ I get that there exists only one homomorphism namely the 0 homomorphism.
Are my claims and arguments correct? If there is any mistake, please help me by correcting it. 
I was also trying to find out how many homomorphisms exist from $\Bbb Z_n$ to $\Bbb Q$ i.e. precisely as group homomorphism and as ring homomorphism. Also, conversely, how many homomorphisms exist from $\Bbb Q$ to $\Bbb Z_n$ again as group homomorphism and ring homomorphism seperately and also how many out of these are epimorphisms (in each case). 
Thanks in advance for helping.
 A: 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.
