I know this is related with Euclid's Lemma (the difference is that the lemma starts by assuming that $p$ is a prime which we don't here). I got this question in an exam and couldn't prove the implication. I started by assuming $q$ was a positive divisor of $p$, but I couldn't seem to go very far.
Edit: A better and more acurate phrasing of the problem would be
Let $a,b, p \in \mathbb{Z}$ prove that if $p>1$ has the property that for any $a,b$ the implication $p|(ab)⇒p|a∧p|b$ holds true, then $p$ is a prime.
Suppose that $p > 1$ and that $p$ is not prime . Then we can write $p = de$, where $d$ and $e$ are proper divisors of $p$, so that $1 < d,e < p$. Clearly $p|(de)$, so $p|d$ or $p|e$, by assumption. But then $p \leq d < p$ or $p \leq e < p$. Contradiction!
EDIT: Just to clarify, what I assume and what you ought to be saying, is that if $p > 1$ has the property that for any $a,b$ the implication $p|(ab) \Rightarrow p|a \wedge p|b$ holds true, then $p$ is a prime.
As stated, you could take $p = 6$, $a=b=2$. Then the implication $p|(ab) \Rightarrow p|a \wedge p|b$ is true because $p|(ab)$ is false, but certainly $p$ is not a prime.