Let $D$ be an integral domain and let $I$ be an ideal in $D$ not containing a non-unit element $x$. Is it true that there is a prime ideal $P$, containing $I$, such that $x \not \in P$? What about a maximal ideal?
This is true (for the prime case) if $I=(0)$, as has been shown in a question posed on this site, but the argument uses Zorn’s Lemma in a way which can’t be directly adapted to this scenario.
In case the answer is negative, is there any condition we can impose on $D$ so that it is true? Maybe a PID? I couldn’t quite figure out what might be necessary…
Thanks in advance!