obviously if either I or J is a subset of P, there is nothing to prove. so to negate that, we need some a in I with a NOT in P, AND b in J with b NOT in P.
but since I is an ideal, ab is in I. since J is an ideal ab is in J. therefore ab is in I∩J, and thus in P. since P is prime, either a is in P, contradicting our choice of a, or b is in P, contradicting our choice of b.
the only conclusion is that we cannot pick such a in I AND b in J outside of P, either I or J must lie within P.