Preimage of prime ideals are prime ideals - contradiction?

I have a question that comes from here (only regarding commutative rings).

Firstly, the theorem: Let $\varphi : R\to S$ be a ring homomorphism. If $S$ is integral, then $\ker\varphi$ is a prime ideal of $R$.

Proof. Preimages of prime ideals are prime under ring homomorphisms which follows directly from the definition. Since $S$ is integral, $(0)$ is prime and thus $\ker\varphi =\varphi^{-1}(0)$ is prime.

Now however we get the contradiction that the trivial homomorphism is not a homomorphism since $R$ can not be a prime ideal. How can this be solved? I mean, clearly $\varphi :R\to S,\ r\to 0$ is a ring homomorphism with $\ker\varphi =R$.

• A ring homomorphism should send 1 to 1. – Ahr Jan 10 '18 at 13:19
• But what if $R$ doesn't have a 1? – Buh Jan 10 '18 at 13:20

The relevant convention here is the one where the multiplicative unit is part of the ring structure; any ring homomorphism $\varphi : R \to S$ must have $\varphi(1_R) = 1_S$.
• @Buh: Actually, the zero ring does have a multiplicative unit. If $Z$ is the zero ring, then $1_Z = 0_Z$. – Hurkyl Jan 10 '18 at 13:27
• @Buh: I wouldn't say it restricts the theory, but instead it changes the theory. The study of associative $\mathbb{Z}$-algebras and algebra morphisms simply has a very different flavor from the study of unital rings and unit preserving morphisms. – Hurkyl Jan 10 '18 at 13:28
• @Buh: But you can actually pass back and forth between them. You've mentioned one direction; in the other you can actually identify any associative $\mathbb{Z}$-algebra $R$ with its unitalization: the ring whose underlying set is $\mathbb{Z} \times R$ and with operations $(a,b)+(c,d) = (a+c,b+d)$ and $(a,b) \cdot (c,d) = (ac, ad+bc)$. – Hurkyl Jan 10 '18 at 13:29
• Okay, you get me there, hehe. But still: $\varphi: \mathbb Z\to \mathbb Z,\ z\mapsto 0$ fullfills all requirements to be a ring homomorphism (aside the unity) so I see no reason to exclude it. What is the reason behind this? – Buh Jan 10 '18 at 13:29