Is there an example of a ring $S$ with identity $1_S$ containing a non-trivial subring $R$ which itself has an identity $1_R$, but $1_R\neq 1_S$ (or equivalently $1_S\notin R$). I'd also like to know under what conditions the identities have to be equal. I know they must be equal if $S$ has no zero divisors, since for every $r\in R$ we have $(1_S-1_R)r=0$

In other words: Is the category of unital rings with identity-preserving morphisms a full subcategory of the category of rings (where morphism are only required to respect addition and multiplication)?

@stefan It's worth drawing attention to the construction of which this is a special case: the ring $eSe$ where $e^2=e\notin \{0,1_S\}$. This relies on the existence of a nontrivial idempotent. Since the identity element of any subring has to be idempotent, you can see that the identity of subrings would have to coincide with the superring's identity if there are only trivial idempotents (like in local rings and in domains).
–
rschwiebJun 22 '13 at 16:58

Another example is the ring made up of $\begin{pmatrix} a & b\\ c & d\end{pmatrix}$, where $a,b,c,d\in\Bbb{R}$. The identity is $\begin{pmatrix} 1 & 0\\ 0 & 1\end{pmatrix}$.

It has a subring: $\begin{pmatrix} a & a\\ a & a\end{pmatrix}$, where $a\in\Bbb{R}$. The identity of this subring is $\begin{pmatrix} \frac{1}{2} & \frac{1}{2}\\ \frac{1}{2} & \frac{1}{2}\end{pmatrix}$.

@dimension10 That's a pretty misleading thing to say without specifying that you mean there is more than one element $x\in R$ such that $xs=s$ for all $s\in S$. Of course, a ring can only contain at most one element acting like an identity.
–
rschwiebJun 22 '13 at 18:43

Let $D_4=\langle x,y\mid x^4=y^2=xyxy=1\rangle,$ and consider the group ring $S=\Bbb C[D_4],$ a vector space of dimension $8$ over $\Bbb C$ with canonical standard basis
$\{\mathbf{e}_{1},\mathbf{e}_{x},\mathbf{e}_{x^2},\mathbf{e}_{x^3},\mathbf{e}_{y},\mathbf{e}_{xy},\mathbf{e}_{x^2y},\mathbf{e}_{x^3y}\}.$ Multiplication in this vector space is given by $\mathbf{e}_{g}\mathbf{e}_{h}=\mathbf{e}_{gh}$ for any $g,h\in D_4,$ with scalars multiplying as usual, and distributivity as expected. The multiplicative identity element of $S$ is $\mathbf{e}_{1}.$

Since the center of $D_4$ is $\{1,x^2\},$ then $\mathbf{v}_{1}:=\frac12(\mathbf{e}_{1}-\mathbf{e}_{x^2})$ commutes multiplicatively with everything in $S.$ Note further that $\mathbf{v}_{1}^2=\mathbf{v}_{1}$. For each $g\in D_4,$ let $\mathbf{v}_{g}:=\mathbf{v}_{1}\mathbf{e}_{g}.$ It can be shown that $\mathbf{v}_{g}\mathbf{v}_{h}=\mathbf{v}_{gh}$ for all $g,h\in D_4,$ and that $\mathbf{v}_{x^2}=-\mathbf{v}_{1},$ so $$\{\mathbf{v}_{g}\mid g\in D_4\}=\{\pm \mathbf{v}_{1},\pm \mathbf{v}_{x},\pm\mathbf{v}_{y},\pm\mathbf{v}_{x}\mathbf{v}_{y}\},$$ whence $$R:=\{a\mathbf{v}_{1}+b\mathbf{v}_{x}+c\mathbf{v}_{y}+d\mathbf{v}_{x}\mathbf{v}_{y}\mid a,b,c,d\in\Bbb C\}$$ is a subset of $S$ that is closed under the addition and multiplication operations of $R$--a subring of $S$--whose multiplicative identity element is $\mathbf{v}_{1}\ne\mathbf{e}_{1}.$