I must be going crazy...
We know that for an integral domain, $R, a \in R$ is prime if and only if $(a)$ is a prime ideal. So taking $R$ to be the integers and $a=2$. Obviously 2 is prime and looking at $(2) = 2\mathbb{Z} = \{0, \pm 2, \pm 4, \pm 6,...\}$. But for $8 = 2 \times 4$ we have both 2 and 4 $\in (2)$ and therefore (2) is not prime...
What am I missing? Thanks, Tal
I'm not sure that you are understanding the concept of a prime ideal correctly. A prime ideal is a proper ideal $I$ such that whenever $a,b\in R$ and $ab\in I$ one has either $a\in I$ or $b\in I$ already. So, in your case, both $a$ and $b$ are in $(2)$ and this ideal fits the definition perfectly.
I am assuming, based on your statement, that you are under the misconception that a prime ideal is an ideal $I$ such that whenever $ab\in I$ one has $a\not\in I$ and $b\not\in I$ (in other words, exactly the negation of the correct definition). Actually, here's the intuition as to why the definition is as it is: a prime number in $\mathbb{Z}$ is a number $p\ne 1$ so that whenever $p|ab$ one has $p|a$ or $p|b$. This translates naturally to the definition that $ab\in(p)$ implies $a\in(p)$ or $b\in(p)$. (This is for $\mathbb{Z}$, which is a principal ideal domain in which all ideals are generated by one element, and so all ideals are of the form $(n)$ for some $n$.)
This answer may provide further insight into the definition of a prime ideal: Motivation behind the definition of Prime Ideal