Every ring homomorphism to the integers is surjective? Let $R \neq 0$ be a commutative, unital ring and $f: R \to \mathbb{Z}$ be a ring homomorphism.
Does this force $f$ to be surjective?
Attempt of Proof:
By the universal property of $\mathbb{Z}$, there is a unique ring homomorphism $g: \mathbb{Z} \to R$. But then $f \circ g: \mathbb{Z} \to \mathbb{Z}$ is the unique ring homomorphism which is already given by $id: \mathbb{Z} \to \mathbb{Z}$. Thus $f \circ g = id$ and therefore $f$ must be surjective.
Does this proof hold? It seems weird that I can nowhere find this result...
 A: The image of a ring homomorphism (preserving $1$) is a subring of the codomain.
Since the only subring of $\mathbb{Z}$ is $\mathbb{Z}$ itself, the statement is proved.
The same is true for ring homomorphisms to $\mathbb{Z}/n\mathbb{Z}$.
Your proof is good as well, but overkill.
A: You certainly assume that a ring homomorphism between unital rings preserves the multiplicative identity.
However, all what we need to show that $f(R) =\mathbb Z$ is the fact that $1 \in f(R)$ - which is an immediate consequence of $f$ being a ring homomorphism. Beyond this fact the multiplicative structure of $R$ is completely irrelevant, your result is true also for non-commutative unital rings $R$. In fact the essence is this:

A group homomorphisms $\phi : G \to \mathbb Z$ is surjective if and only $1 \in \phi(G)$.

One half is trivial. For the other part, let $g \in G$ such that $\phi(g) = 1$. Then clearly $\phi(g^n) = n $.
A: If $f$ is a ring homomorphism, then for the unit elements $f(1_R) = 1_Z$.
For completeness define of multiples of ring elements (unit element is only require):
For each natural number $n$, write $n\cdot 1_R = 1_R+\ldots+1_R$ $n$-times and for each negative integer $n = -m$, where $m>0$, write $n\cdot 1_R = -(m\cdot 1_R)$.
Then for each integer $n$, $f(n\cdot 1_R) = n\cdot f(1_R) = n\cdot 1_Z$.
It follows immediately that the mapping is onto.
