# Homomorphism question (group theory)

I have a doubt regarding one of my textbook problems regarding homomorphisms.

My textbook says:

"Suppose that we wish to determine all possible homomorphisms $\phi$ from $\mathbb{Z}_7$ to $\mathbb{Z}_{12}$.

Since $\ker\phi$ must be a subgroup of $\mathbb{Z}_7$, there are only two possible kernels, $\ker\phi=\{0\}$ or $\ker\phi=\mathbb{Z}_7$.

The image of a subgroup of $\mathbb{Z}_7$ must be a subgroup of $\mathbb{Z}_{12}$. Hence, there is no injective homomorphism; otherwise $\mathbb{Z}_{12}$ would have a subgroup of order 7, which is impossible.

Consequently, the only possible homomorphism from $\mathbb{Z}_7$ to $\mathbb{Z}_{12}$ is the one mapping all elements to zero."

I don't understand how the last sentence follows from the preceding ones. Just because there is no injective homomorphism, why does it mean that everything in $\mathbb{Z}_7$ is mapped to zero? Why can't $\mathbb{Z}_7$ be mapped to $\mathbb{Z}_4$, for instance?

Let $\phi$ be a homomorphism from $\mathbb{Z}_7$ to $\mathbb{Z}_{12}$. Then as you said, $\ker\phi=0$ or $\ker\phi=\mathbb{Z}_7$. In the first case, $\ker\phi=0$ means $\phi$ is injective since $\ker\phi$ is by definition all elements that go to $0$ under $\phi$. So the image of $\phi$ is a subgroup of order $7$ inside of $\mathbb{Z}_{12}$. But since $7$ does not divide $12$, this is not possible. So only the second case happens, i.e. $\ker\phi=\mathbb{Z}_7$. This says all elements go to $0$, i.e. $\phi$ is the $0$ map.
That is because, as $\phi$ cannot be injective, i.e. $\ker\phi\neq\{0\}$, necessarily $\;\ker\phi=\mathbf Z_7$.