You seek to prove that, for any $p \in \mathbb{Z}^+ - \{1\}$, if $p \mid ab \implies p \mid a$ or $p\mid b$, for every $\{a, b\} \subset \mathbb{Z}$, then $p$ is prime.
The contrapositive to such a statement would be, as you correctly stated, that, if $p$ is not a prime, then there must be $\{a, b\} \subset \mathbb{Z}$ such that $p \mid ab$, but $p \nmid a$ and $p \nmid b$.
The example you provide also is correct. However, an example by itself is not sufficient to prove the contrapositive. What you would need to show is that every non-prime $p$ verifies that there are $\{a, b\} \subset \mathbb{Z}$ such that $p \mid ab$ but $p \nmid a$ and $p \nmid b$. Currently, you have only provided a single example of a non-prime that verifies such a property.
In my opinion, the main result you could make use of would be the Fundamental Theorem of Arithmetic (i.e., prime decomposition). Shortly stated, it tells you that every positive integer $n$ ($>1$) can be decomposed into a product of powers of $k$ primes. That is, for every $n \in \mathbb{Z}^+ - \{1\}$, there exist $\{p_1, \dots, p_k\} \subset \mathbb{P}$ ($\mathbb{P}$ here the set of primes) and $\{n_1, \dots, n_k\} \subset \mathbb{Z}^+$ so that
$n = p_1^{n_1} \dots \ p_k^{n_k} = \prod_{i = 1}^k p_i^{n_i}$.
Thus, suppose $p$ a non-prime divides $ab$ an integer. As $p$ is $>1$ and division is irrespective of sign, we can consider, without any loss of generality, both $a$ and $b$ to be $>1$ (clearly, if we could not "get down" to such a form —say if $a$ were always $=1$—, then we would be left with $p$ a non-prime dividing $b$ a prime).
Now, as $ab$ is a positive integer ($>1$), we can decompose it into the product of its prime factors. Say, $ab = p_1^{n_1} \dots \ p_k^{n_k}$, with $k > 1$.
Thus, $p \ | \ p_1^{n_1}(p_2^{n_2} \dots \ p_k^{n_k})$ (we can assume $k$ to be $>2$ as otherwise $p$ would divide the product of —powers of— two primes, and would be left with no choice but to be a prime itself). Hence, $p \ | \ p_1^{n_1}$ or $p \ | \ p_2^{n_2} \dots \ p_k^{n_k}$. If the former were the case, $p$ would no doubt be a prime, thus it must be that $p \ | \ p_2^{n_2} \dots \ p_k^{n_k}$.
We can, however, immediately see the problem here. Such an argument can be iterated yet again, and again. The "partitioning" into two parts of the products considered must eventually come to an end, as $k$ itself is finite. When such happens, we will be left with one of two choices: (1) $p$ did not divide any of the partitioned components, in which case the very hypothesis we were working off (i.e., that $p$ would always divide —at least one— of the components) would fail; or (2) $p$ did divide some component $p_j^{n_j}$, in which case our hypothesis that $p$ was non-prime also fails.
As either case leads to an insoluble contradiction, we can only but conclude that $p$ must have been a prime to begin with. $\square$
blah
", then the negation would be "there exists an x for which not(blah
)". But if b is of the form "there is an x such thatblah
", then the negation would be "for all x, not(blah
)". Etc. – Arturo Magidin Oct 19 '23 at 15:29