Can an ideal of a ring be an ideal of a subring/superring too? Let $R\neq S$ be rings with unity. Let $R$ be a subring (sharing the same unity) of $S.$ Let $\{0\}\neq K\subseteq R.$ Is it possible that $K$ is at the same time an ideal in $R$ and an ideal in $S?$
 A: Consider $S = \mathbb Q[x]$, the rational polynomials in one unknown.  Define $R = \mathbb Z + \mathbb x\mathbb Q[x]$.  Now $K = x\mathbb Q[x]$ is an ideal in both rings.
A: Let $S$ be the set of sequences in $\mathbb{Z}/\mathbb{2Z}$, which is a ring with term-wise addition and multiplication. The set of sequences that are eventually constant is a subring R (it contains $1=(1,1,1,...)$). The set of sequences that are eventually zero is an ideal $K \subset R$ such that $K \lhd S$.
A simpler example works with $S=\mathbb{Z}/\mathbb{2Z} \times\mathbb{Z}/\mathbb{2Z} \times \mathbb{Z}/\mathbb{2Z}$, $R$ being the subring with the last two entries the same, and $K$ being the ideal with the last two entries zero.
A: If $K$ is an ideal in $S$, then it's an ideal in $R$ (by definition). 
Example:
$$
K=\left\{\left(\begin{array}{cc}0&b\\ 0&c\end{array}\right):b,c\in\mathbb R\right\}
$$
is a left-ideal in
$
R=\left\{\left(\begin{array}{cc}a&b\\ 0&c\end{array}\right):a,b\in\mathbb R\right\}
$
and in $S=M_2(\mathbb R)$.
Conversely, it's not true that if $K$ is an ideal in $R$ then it is neccesarly an ideal in $S$. 
Counterexample: 
$$
K=2\mathbb Z\subset R=\mathbb Z\subset S=\mathbb Z[\sqrt{2}]=\{a+b\sqrt{2}:a,b\in \mathbb Z\}.
$$
Clearly, $2\mathbb Z$ is not an ideal in $\mathbb Z[\sqrt{2}]$.
A: Let $O$ be a valuation domain of Krull dimension >1 and let $p\neq 0$ be a non-maximal prime of $O$. Then every proper ideal of the localization $O_p$ is a proper ideal of $O$ itself.
To show this it suffices to prove the inclusion $pO_p\subset O$: It then follows that $pO_p=p$ and since $pO_p$ is maximal, every ideal of $O_p$ is contained in $p$ and thus in $O$.
So assume that some element $\frac{a}{b}$, $a\in p$, $b\in O\setminus p$ is not in $O$. Since $O$ is a valuation domain one concludes $\frac{b}{a}\in O$, hence $b\in p$, a contradiction.
A: Another example: $\mathbb Z$ embeds into $\mathbb Z[x]/(2 x)$, then $(2)$ is an ideal in both rings.
