P\a
If p is prime, then p does not divide a. And p does not divide b. By definition of being prime. (Unless a and b are 1 and p).
So proving that p divides a or b would be rather difficult, no?
Are you sure you've got the question right?
a and b are integers, I'm assuming...
This theorem is correct. ("$\displaystyle p|a$" means that $\displaystyle p$ divides $\displaystyle a$, or that $\displaystyle a$ is a multiple of $\displaystyle p$, not the contrary)
It results from Gauss Theorem: We assume that $\displaystyle p|ab$. If $\displaystyle p|a$, we are done. Suppose $\displaystyle p\not|a$. Then $\displaystyle a$ and $\displaystyle p$ are relatively prime.
(If $\displaystyle d$ divides $\displaystyle a$ and $\displaystyle p$, then $\displaystyle d=1$ or $\displaystyle d=p$ because $\displaystyle p$ is prime, hence necessarily $\displaystyle d=1$ since $\displaystyle p\not|a$; hence $\displaystyle 1$ is the only positive common divisor of $\displaystyle a$ and $\displaystyle p$)
Because $\displaystyle p|ab$, you deduce from Gauss Theorem that $\displaystyle p|b$. qed