To avoid repeating it endlessly, assume all rings and rngs are commutative. I do not know if this is necessary.

The question then is exactly the title, but I think a stronger statement is true:

For any rng $S$ there is a ring $R$ and an injective rng-homomorphism $f:S\rightarrow R$ such that for

anyring$T$ andanyrng homomorphism $g:S\rightarrow T$, there is aringhomomorphism $h:R\rightarrow T$ such that $h$ extends $g$.

In fact I think the construction is pretty clear; let $X=( x_s : s\in S )$ be a set indexed by $S$, and let $R=\mathbb Z[X]/I$, where $I=( x_a+x_b-x_{ab} : a,b\in S) \cup (x_a*x_b-x_{ab} : a,b\in S)$.

It seems clear that if a universal object can exist, this has to be it. But I'm having trouble proving the natural map $f:S\rightarrow R$ (given by $f(a)=s_a$) is actually injective like it ought to be. Is there some classical universal property I'm missing here, or is there a slick way to ignore the details?

Also, I don't think the commutativity is at all necessary for the problem, it's just the situation I'm most used to. I think a similar construction (the free algebra on $S$ and $1$, modulo the same $I$) would do fine for the noncommutative case, and is isomorphic to this in the commutative case.