So, I've been given the actual definition of a prime for the first time, as opposed to the definition of an irreducible which I was previously taught (as is customary), it goes as follows:
An element $p$ of a ring $R$ is called "prime" if $a,b\in R$ and $p|ab\rightarrow p|a$ or $p|b$
$4^2 = 16$. So inversely $4|16$. Now let's look at all the combinations of two integers $a,b\in R$ where $ab = 16$ and whether $p|a$ or $p|b$:
$1 * 16$ ($4|16$)
$2 * 8$ ($4|8$)
$4 * 4$ ($4|4$)
By my logic, $4$ is prime.
However, as we all know $4 = 2^2$. But $2$ is not a unit so $4$ is an irreducible. Since the ring of integers is an integral domain $4$ must, therefore, be prime as well. Why does this happen?
Edit
Thanks for your help everyone. I understand your answers logically and experimentally but not really conceptually. The reason this definition works (from my perspective) because your saying that
A number is prime if it necessary to represent its multiples in factorisations.
Whereby factorisations, I mean $8 = 2^3, 6 = 2*3$ and relevantly $16 = 2^4$.
The answer I had kind-of expected from this question (and was going to include in my original query until I forgot) was that more generally if there exists the product of any amount of numbers that is equivalent to $ab$ and for each of those numbers $n$, $n$ suffices $p|n$ then $p$ is composite.
This makes much more sense to me logically. In the case of $16$ you saying that you don't need $4$ to express $16$ since you can instead use $2*2*2*2$ or $2^4$ to represent the same thing. For this reason, $4$ is composite.
By this logic, you don't need to prove it for every multiple of 4, only 1. Have I completely confused myself? Can someone provide a counter-example? Also, could you provide an explanation of why my logic doesn't work?
Edit 2
Yes everyone, the correct definition of includes checking the factors of every $ab$ such $p|ab$. However, as @Vincent and I showed in our respective answers (the former much better) the definition I used is equivalent to the definition everyone else is using in integral domains. I highly suggest you read @Vincent answer as he makes this very clear.
Regardless, I'm not accepting any answer that simply says that my definition is wrong when it is actually equivalent.
This is an answer to the accepted answer more than to the question, but I believe that that is ok, since both are posed by the same poster.
NOTE: I CHANGED SOME THINGS AFTER READING DARIJ'S COMMENT
The question seems to be which of four definitions of prime element is the 'correct' one. I restate the definitions here, but let them define four different types of elements (prime1, prime1', prime2, prime3). The reason for this somewhat awkward notation is that it enables us to say things like 'The element $4 \in \mathbb{Z}$ is prime2 but not prime1' and know exactly what we are talking about.
So here are the definitions.
I use the names prime1 and prime1' to emphasis that these definitions are really identical. Just try to think for 2 seconds what you would need to do to show that an element $p$ is not prime1 or not prime1'. In both cases it amounts to the same thing: find two elements ($a, b$) that are not divisible by $p$ while their product ($c$) is.
Things get more interesting when we invoke the other two definitions.
Now the content of the original question is that the number $4 \in \mathbb{Z}$ is prime2, showing that 'prime2-ness' is not a good way of generalizing 'primeness' (primality) of integers to arbitrary rings. Very nice, I never thought of that before. However, for now that means that prime2 is out as a candidate definition of "prime" and the race is between prime1 and prime3. (I ignore prime1' for the moment as it is identical to prime1).
The counterexample the OP is asking for seems to be a natural number that is prime3 but not prime in the ordinary sense. In fact it would already be interesting to see any element of any integral domain that is either prime3 but not prime1 or prime1 but not prime3. The point of my answer is: these elements do not exist. Concretely we have:
Together the theorems say that the two definitions are equivalent and hence that choosing the one over the other is a matter of taste (or pedagogy) and doesn't change anything mathematically.
I will prove the theorems below.
Proving Theorem 1 is really easy, there is hardly anything to do. We have an element $p$ that is prime3 and elements $a, b$ such that $p|ab$. Taking $c = ab$ and $S = \{a, b\}$ we see that from prime3-ness of $p$ that $p|a$ or $p|b$ which in turn implies that $p$ is prime1. End of proof.
Proving Theorem 2 is a bit more involved.
Let $p$ be a prime1 element of $R$. Let $c$ be any element of $R$ such that $p|c$ and let $S \subset R$ be any finite set such that $\prod_{s\in S} s = c$. We need to show that there is an element $s \in S$ such that $p|s$ in order to show that $p$ is prime3. We do this by induction on the number $n$ of elements of $S$.
The first hurdle we have to tackle is the fact that if $n = 0$ then our goal is unreachable: clearly in an empty set there is no element $s$ such that $p|s$. Luckily this case does not occur! The point is: the product of all elements of an empty set is 1 by definition. But if $c = 1$ and $p|c$ then $p$ is a unit, which contradicts its prime1-ness. So this case cannot happen.
We move on to the case $n = 1$. If $S$ contains only a single element then clearly this single element must be the element $c$, which was the product of all elements. But we already know that $p|c$ and so, indeed, $p$ divides a (or rather: the) element of $S$.
Now let $n \geq 2$ and we suppose that ('Induction Hypothesis') that for all $a \in R$ with $p|a$ and all $S' \subset R$ with $n-1$ elements such that $\prod_{s \in S'} s = a$ we have that $p$ divides some element of $S'$.
We are still working with the $n$-element set $S$ and we label the the elements $s_1, s_2, \ldots, s_{n-1}, s_n$. Let $a = s_1 \cdot s_2 \cdots s_{n-1}$ and $b = s_n$. Then $ab = c$ and hence $p|ab$ and hence, since $p$ is prime1 we have that $p|a$ or $p|b$. In the second case we see that $p|s_n$ and hence we see that $p$ divides an element of $S$ as we wanted to show. In the first case we set $S' = \{s_1, \ldots, s_{n-1}\}$. Since $p|a$ we know from the Induction Hypothesis that $p$ divides some element of $S'$. But every element of $S'$ is also an element of $S$, so in this case we have that $p$ divides an element of $S$ as well, as we wanted to show.
End of proof.
In summary: the new definition from your answer and the old definition from the other answers are equivalent and single out the same elements of $R$.