TITLE: A subset of a ring R closed under addition and multiplication by elements of R that is not an ideal of R
QUESTION [6 upvotes]: A subset $I$ of a ring $R$ is an ideal if and only if $I$ is closed under subtraction and multiplication by elements of $R$. If $R$ has unity, this is equivalent to $I$ being closed under addition and multiplication by elements of $R$. Can anyone think of an example showing these conditions are not equivalent in general, i.e. that there is a ring $R$ (without unity) and a subset $I\subseteq R$ such that $I$ is closed under addition and multiplication by elements of $R$, but $I$ is not an ideal of $R$?

REPLY [6 votes]: Take $\mathbb Z$ with trivial multiplication, that is, $xy=0$ for all $x,y\in \mathbb Z$.
Then $\mathbb N$ (meaning the nonnegative integers) is closed under addition and multiplication by elements from $\mathbb Z$. But it's not an ideal since it's not an additive subgroup of $\mathbb Z$.