Subring which is not an ideal?

Solution 1:

Your example looks correct.

An easier example (at least notationally) seems to be: Let $R = \mathbb{Z}_3 \oplus \mathbb{Z}_3$. We see that $S = \{(0, 0), (1, 1), (2, 2)\}$ is a subring isomorphic to $\mathbb{Z}_3$, but $(1, 2)*(1, 1) = (1, 2)$, which is not an element of $S$, so it cannot be an ideal.

A much easier example (allowing the ring to be infinite): Try the ring (really a field) $\mathbb{Q}$ and the integers $\mathbb{Z}$. Clearly $\mathbb{Z}$ is a subring of $\mathbb{Q}$, but it is not an ideal of $\mathbb{Q}$ (which has only two ideals, $0$ and itself).


Of course I overlooked the simplest example: Let $R = \mathbb{Z}_2 \oplus \mathbb{Z}_2$ and take $S = \{(0, 0), (1, 1)\}$. Then $S$ is clearly a ring (as in the first example), while $(1, 0)*(1, 1) = (1, 0) \notin S$. This is your example is in the original post, just in a much easier to recognize form.

Solution 2:

You could try the ring of dual numbers $\mathbb{F}_2[x]/x^2$ where $\mathbb{F}_2$ is the field with two elements. It has four elements and the subset $\{0,1\}\cong {\mathbb{Z}}/2$ is a subring but not an ideal.