What is an example of a non-zero "ring pseudo-homomorphism"?

Because $f(1_R) = f(1_R^2) = f(1_R)^2$ be know that $1_R$ must be mapped to an idempotent element of $S$. We can use this to construct some counterexamples:

Take for example a commutative ring $R$ and a not-necessarily commutative or unital (but associative) $R$-algebra $A$. For any idempotent $e \in A$ the map $R \to A, r \mapsto re$ does the trick. This map is only unital if $A$ is unital and $e = 1_A$.

One examples of this is a ring (i.e. $\mathbb{Z}$-algebra) $S$ with an idempotent $e \in S$. (If $ne = 0$ for some $n \geq 2$ then this also results a pseudo ring homomorphism $\mathbb{Z}/n \to S$. Matt Samuel’s answer is an example of this with $S = \mathbb{Z}/6$, $e = 3$ and $n = 2$.)

If $k$ is a field then the matrix algebra $\mathrm{M}_n(k)$ gives us lots of idempotents (unless $k$ is finite and $n$ is small, or $n = 1$), as there is a bijection between the idempotents of $\mathrm{M}_n(k)$ and the direct sum decompositions $k^n = U \oplus V$ (where we regard $U \oplus V$ and $V \oplus U$ as two different decompositions).

Another class of examples arises by taking a product of unital rings $\prod_{i \in I} R_i$ and considering the idempotent $e_j = (\delta_{ij})_{i \in I} \in \prod_{i \in I} R_i$; we can use this to construct the pseudo ring homomorphism $R_j \to \prod_{i \in I} R_i$, $r \mapsto r e_j$, which is only unital if $|I| = 1$.


Every commutative example takes the following form. Suppose $f : R \to S$ is a non-unital ring homomorphism between two commutative rings. Then $f(1_R)$ is some idempotent $m \in S$, as Jendrik Stelzner remarks. $mS$ is a "non-unital" subring of $S$ (it's a subring except that its unit is $m$, not $1_S$), and $f$ is a ring homomorphism in the ordinary sense to this subring. Moreover, $S$ decomposes as a product of rings

$$S \cong mS \times (1 - m)S.$$

So darij's comment essentially exhausts all examples.

Geometrically such a morphism corresponds to a "partially defined" morphism $\text{Spec } S \to \text{Spec } R$ of affine schemes, where "partially defined" means defined on some union of connected components. There are analogous statements one can make about non-unital C*-algebra homomorphisms between commutative C*-algebras.


Try the homomorphism $$\mathbb Z_2\to \mathbb Z_6$$ given by $$[1]_2\mapsto [3]_6$$