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 *any* *ring* $T$ and *any* rng homomorphism $g:S\rightarrow T$, there is a *ring* homomorphism $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.



Are all (commutative) rngs ideals of (commutative) rings?
You're wondering about the existence of a left adjoint to the forgetful functor from rings to rngs. Of course it exists. It sends a rng $S$ to $R=S\oplus \mathbb{Z}$ with multiplication $(s,n)(s',n')=(ss'+ns'+sn',nn')$.


