I need help to solve this problem

Let $R$ be a subring of a field $F$ such that for each $x \in F$ either $x\in R$ or $x^{-1} \in R$. Prove that if $I$ and $J$ are two ideals of $R$, then either $I \subseteq J$ or $J \subseteq I$.

• note that such a R is called a valuation ring – Loreno Heer Jan 25 '15 at 12:34

Suppose not. Then there exist some $x \in I \setminus J$ and $y \in J \setminus I$. Clearly $x,y \neq 0$ and they are not invertible in $R$. Now, either $xy^{-1} \in R$ or $yx^{-1} \in R$.

In the case $xy^{-1} \in R$, we have $x= (xy^{-1})y \in J$, and this is a contradiction.

In the case $yx^{-1} \in R$, we have $y= (yx^{-1})x \in J$, and this is a contradiction.

Suppose that I is not contained in J and pick an element $x \in I-J$. Let $y \in J$. Assume $y \neq 0$. $y/a \in R$ and therefore $b = (b/a)a \in I$.

Suppose

$$\;I\not\subset J\;\implies\;\exists\,x\in I\setminus J$$

Suppose now that $\;y\in J\;$. Clearly we can assume $\;y\neq 0\;$, otherwise trivially $\;y=0\in I\;$ , but then

$$\frac xy\notin R\,,\,\,\,\text{otherwise}\;\; x=\left(\frac xy\right)y\in J\;\;\text{, contradiction}.$$

And thus it must be

$$\frac yx\in R\implies y=x\left(\frac yx\right)\in I$$