A ring with a subring that is a field

I'm looking for an example of a ring $R$ such that $R$ has no multiplicative identity, but R has a subring $A$ which is a field

-
Are you familiar with the direct product? Could you think of a way of a constructing such a ring by taking products of other rings (or maybe fields)? – JSchlather Nov 28 '11 at 5:06
On the one hand, I would like to take a field; on the other hand, I would like to take something like the even integers. How to do things ambidextrously? – Arturo Magidin Nov 28 '11 at 5:08
What about this? What about this? $R = n \mathbb{Z} \times \mathbb{R}, n \in \mathbb{N}$ $A = \{0 \} \times \mathbb{R}$ – pigishpig Nov 28 '11 at 5:46
@LarryX: That will often work, but not if $n=1$. You can post an answer to your own question. – Jonas Meyer Nov 28 '11 at 8:28

Here a simple example: take $\mathbb K$ a field and consider the ring $R=xK[x]$. The ring $\mathbb K \times R$ has no identity, but it has a sub ring $\mathbb K \times \{0\}$ is isomorphic to $\mathbb K$, so it's a field.

-
Your "ring" $R$ is not additively closed and does not contain 0. I suppose you meant $R=x\mathbb{K}[x]$. In fact any rng without identity will work for $R$. – Marc van Leeuwen Nov 28 '11 at 10:35
@MarcvanLeeuwen yes you're right, I'm sorry for the mistake. Thanks for the correction, I've edited the answer. – Giorgio Mossa Nov 28 '11 at 13:07
@JyrkiLahtonen Marc van Leeuwen is right, sorry for the mistake, I've edited answer. – Giorgio Mossa Nov 28 '11 at 13:08

A slightly different example would be the rng (= ring without 1) of 2x2 matrices over the reals of the form $$M(a,b)=\pmatrix{a&b\cr0&0\cr}.$$ We have $M(a,b)M(c,d)=M(ac,ad)$, so no (2-sided) multiplicative identity element exists, and this is a rng with respect to the usual matrix operations.

OTOH the matrices of the form $M(a,0)$ form a subring isomorphic to $\mathbf{R}$.

-
Replace $\mathbf{R}$ above with your favorite finite field, if the exercise calls for such an example. – Jyrki Lahtonen Nov 28 '11 at 10:28

I'll go against the temptation of posting a trivial answer as a comment. Polynomials in $X$ (or more indeterminates) over any given field are probably the best known example of the situation you describe, the subring being the constant polynomials. Any decent algebra course should give this example immediately after defining rings and fields.

Added This answer is wrong, I misread the question (because for me rings always have a multiplicative identity, which is apparently not intended here): I thought it was about non-field rings with a subring that is a field. Maybe the title should say "A rng with a subring that is a field"

-
Unfortunately if the subring of constant polynomials is a field, then it often happens that the ring of polynomials has a multiplicative identity. – Jyrki Lahtonen Nov 28 '11 at 10:17
@Jyrki: You're right, I misread the question (with multiplicative inverse instead of identity), or more precisely I read the title instead of the question. I guess I should delete my misguided reply, but I'll just add that it is incorrect. – Marc van Leeuwen Nov 28 '11 at 10:25