One contradiction between maximal ideals and prime ideals.

First of all, according to the textbook that I use, there are some theorems about maximal and prime ideals.
(a) If R is a commutative ring such that R2=R, then every maximal ideal M in R is prime.
(b) In a commutative ring R with identity maximal ideals always exist.
(c) In a commutative ring R with identity 1R, which is not equal to 0, an ideal P is prime iff the quotient ring R/P is an integral domain.

It seems all right, but the contradiction happens when I think about Zm, the integers modulo m with m not prime.
This is my reasoning:
First, Zm is a commutative ring with identity 1R, which is not equal to 0. And since the identity exists in this ring, Zm2=Zm, so maximal ideals exist and they are prime.
On the other hand, since m is not prime, Zm has zero divisors, say xy=m, 1<x,y<m, then for all ideals I in Zm, Zm/I has zero divisors because (x+I)(y+I)=xy+I=I where x+I and y+I are not equal to I. This means Zm/I is not an integral domain for all ideals I in Zm. By (c), all ideals are not prime. But what about the maximal ideals? They do exist and they're prime.

this tells us (by (c)) that (4) must not be a prime ideal of Z12, and thus (a) tells us (4) cannot be maximal (but we knew that already, right?).

*********

the flaw in your reasoning is in assuming Zm/I must contain 0-divisors for any I. yes if xy = m, then (x + I)(y + I) = xy + I = I. but with m = 12, we have the following possibilities:

x = 1, y = 0 <--then y + I = I
x = 2, y = 6 note that we have x in I for I = (2), and y in I for I = (3), which are the only maximal ideals of Z12.
x = 3, y = 4 now x is in I for I = (3), and y is in I for I = (2).

we never have a situation where neither x NOR y is in a maximal ideal.