Let $R$ be a commutative ring with $1$. Show that if $I,J$ are ideals of $R$ such that $I\cap J\subseteq P$ and $J\nsubseteq P$, then $I\subseteq P$ 
Question: Let $R$ be a commutative ring with $1$ and $P$ a prime ideal of $R$. Show that if $I,J$ are ideals of $R$ such that $I\cap J\subseteq P$ and $J\nsubseteq P$, then $I\subseteq P$

Thoughts: By contradiction, suppose $I\nsubseteq P$.  Then there exists $i\in I-P$ and $j\in J-P$ where $ij\in I\cap J$, since $I$ and $J$ are ideals.  Since $I\cap J\subseteq P$, $ij\in P$, a contradiction since $i$ is not in $P$ and $j$ is not in $P$, but $P$ is a prime ideal.  Thus $I\subseteq P$.
Does this look correct?  I feel like I may be missing something.  Thank you!
 A: Your argument is correct (maybe it would be nice to make the $i\in I\setminus P,\,j\in J\setminus P\implies ij\in I\cap J$ part a bit more explict, but that might be just me).
However, a relevant note on style: There is no need to frame this proof as proof by contradiction!
Indeed, suppose we are given ideals $I,J\leqslant R$ in a commutative unital ring $R$, a prime ideal $P\leqslant R$ such that $I\cap J\subseteq P$ and $J\nsubseteq P$. Then there is some $j\in J$ which is not contained in $P$ (i.e. $j\in P\setminus J$). On the other hand, for every $i\in I$ we have
$$
ij\in IJ\subseteq I\cap J\subseteq P
$$
by assumption. Hence, $ij\in P$ implying that $i\in P$ or $j\in P$ since $P$ is prime. However, we have chosen $j$ such that $j\notin P$ and hence it follows that $i\in P$. Since $i\in I$ was arbitrary we conclude that $I\subseteq P$.
In my opinion, direct proofs are often much clearer than a proof by contradiction which introduces more and more additional assumptions along the way. So this alternative might highlight this.

Now that I think about it: Your proof is closer to one by contrapositive!
I.e., consider the proposition "if $I\cap J\subseteq P$, then $I\subseteq P$ or $J\subseteq P$". Then your statement covers the non-trivial case of $J\nsubseteq P$ (equivalently, $I\nsubseteq P$). The contrapositive of the proposition is "if $I\nsubseteq P$ and $J\nsubseteq P$, then $I\cap J\nsubseteq P$" and your proof shows precisly this statement.
But again: There is no need to frame this proof as proof by contradiction! And this is another valid alternative.
A: Your argument is exactly correct! Another way of thinking about things is the following alternative criterion for a proper ideal $P<R$ to be prime:

$P$ is prime if and only if, whenever $IJ\leqslant P$ for ideals $I,J\leqslant R$, then one of $I\leqslant P$ and $J\leqslant P$ holds.

Now you just note that $IJ\leqslant I\cap J$ for any ideals $I,J$ of a commutative ring, and the desired result follows. The proof of the highlighted equivalence is almost identical to the proof you've written in your post; as an exercise, try to prove it! However, the two notions do not necessarily coincide if $R$ is non-commutative, and the latter definition is actually often used as a definition of a prime ideal in a non-commutative ring; see for example here.
