In Gallian's Contemporary Abstract Algebra, one of the exercises is to show that if $D$ is a principal ideal domain, then show that every proper ideal of $D$ is contained in a maximal ideal of $D$.
My thinking is to just assume for contradiction that there is some proper ideal $I$ of $D$ such that for any maximal ideal $M$, $I \not\subset M$. But then $I$ is a maximal ideal and is contained in itself.
My question is why is being a PID necessary? Is my proof wrong, or does this just hold for all integral domains?
EDIT: So I figured out a proof of the statement with the PID condition:
Consider a proper ideal $I$ of $D$. Then $I = \langle p \rangle$ and we can assume $p$ is reducible, otherwise $I$ is maximal. So there exist $q,r \in D$ such that $q$ is irreducible, $r$ is not a unit, and $p=qr$. Then $I \subset \langle q \rangle \subset D$.
So is Zorn's Lemma necessary to prove the more general statement or is there a way around it?