Suppose that p has the property p | ab implies p | a or p | b (or both). Now let d be a divisor of p. Then p = de for some e: note that e is also a divisor of p. So in particular p | de and so p | d or p | e. We are in the situation where f | p and p | f, where f is either d or e. But if p = fu and f = pv then p = puv. So uv=1 and u,v are integers, so u,v = +- 1. So if d | p then either d = +-1 or d = +- p. But this means that p is prime, that is, has no non-trivial divisors.