We have the following theory: Let $J$ be an ideal of $\mathbb{Z}$, then $J$ is a prime ideal if and only if $J= n\mathbb{Z}$ for some prime number $n$.
Problem
The problem is with the proof. I understand that any ideal of $\mathbb{Z}$ must be in the form $n\mathbb{Z}$ for some integers $n$. But why $n|xy$ if and only if $n|x$ or $n|y$ implies that $n$ is a prime number? Frankly, whenever I see the divisor sign I fret because primes feel so frightening to me, but it appears here and there in abstract algebra.


Claim: We have $$''n|xy \iff n|x \quad \textrm{or} \quad n|y''$$ if and only if $n$ is prime.
Proof:
Only if: We prove by contradiction. If $n$ is not prime, say $n = ab$ with neither of $a$, $b$ equal to $\pm n$, then $n|ab$ but $n \not | a$ and $n \not | b$.
If: If $n$ is prime, then the fundamental theorem of arithmetic (i.e., thinking about prime decompositions) tells us that the given property holds. If a prime number appears in the prime decomposition of a product of two numbers, it must appear in the prime decomposition of one of the numbers. $ \qquad\square$
Really, in ring theory, this property is the definition of a prime element, and it happens that the prime numbers (along with their negatives) are exactly the prime elements of the ring $\mathbb{Z}$. The familiar definition of prime numbers actually means exactly that they (and their negatives) are the irreducible elements of the ring $\mathbb{Z}$, and, because $\mathbb{Z}$ is a UFD (which is another way of stating the fundamental theorem of arithmetic), the irreducible elements are exactly the prime elements.
If you still have questions, please comment and I will try to expand my answer.