Need help to show $R/I$ is not necessarily flat over $R$

Let $R$ be a ring with unit and $I$ an ideal in $R$. I want to show that $R/I$ is need not be flat over $R$, but I do not know how to come up with a counter-example.

Any hint is appreciated.

-
What examples of non-flat modules do you know? [Interestingly, if $I$ is finitely generated then there's really only one way for $R/I$ to be flat — $I$ has to be generated by an idempotent, and hence $R = I \times (R/I)$ as rings.] –  Dylan Moreland Aug 16 '12 at 17:09
Dear james. If you are studying commutative algebra and have not yet seen the examples given in the answers I suspect the lecture notes or the book you are following has some room left for improvement. You might want to have a look at Atiyah-Macdonald, I read most of it and I think it's excellent. –  Matt N. Aug 16 '12 at 17:28
Alas, this is one of those questions where examples of flat $R/I$ are hard to find: if you tried just about anything at all, it would likely have been a counter-example. The question you probably should have asked is along the lines of "How do I tell if $R/I$ is flat or not?" (assuming, of course, that you really did consider various $R$ and $I$ and weren't able to tell) –  Hurkyl Aug 16 '12 at 22:20

Consider $R = \mathbf Z$ and take the ideal $I = 2\mathbf Z$. Now take a look at the exact sequence $0\to 2\mathbf{Z}\to\mathbf{Z} \to \mathbf{Z}/2\mathbf{Z} \to 0$.

Can you see what happens when you tensor this exact sequence over $\mathbf{Z}$? You should be able to prove that the resulting sequence cannot be exact.

-

Analysis of the problem:
Suppose that $R/I$ is flat over $R$.
Then tensoring the short exact sequence $0\to I\to R$, by $R/I$ yields a new exact sequence $$0\to I\otimes_R R/I \to R\otimes_R R/I\quad (*)$$ Recalling the standard identification $M\otimes_R R/I\xrightarrow {\cong} M/IM:\tilde m\otimes \tilde r\mapsto \overline {rm}$ for any $R$-module $M$, we get from $(*)$ the injective map $$0\to I/I^2\to R/I:\tilde i \mapsto \overline {i} =\bar 0 \quad (**)$$ But the morphism $(**)$ is clearly the zero map.
It can only be injective if $I/I^2=0$ or equivalently if $I=I^2$. So we have proved $$R/I \; \text {flat} \implies I=I^2$$

Conclusion:
By contraposition, if $I\neq I^2$ the $R$-module $R/I$ is guaranteed to be non-flat.
So in a non formal but very clear sense $R/I$ is practically never flat since an ideal is practically never equal to its square .
Here is a result ( a consequence of Nakayama's lemma) corroborating this informal statement :
Theorem:
If $I$ is finitely generated and $I=I^2$, then $I=(i)$ for some idempotent $i=i^2\in R$
Corollary:
If $R$ is a noetherian domain and $0\subsetneq I\subsetneq R$ an ideal, then $R/I$ is not flat.

-

Take the exact sequence $$0 \to \mathbb Z \xrightarrow{\cdot 2} \mathbb Z \to \mathbb Z / 2 \mathbb Z \to 0$$

and tensor with $\mathbb Z / 3 \mathbb Z$ to get $$0 \to \mathbb Z \otimes \mathbb Z / 3 \mathbb Z \xrightarrow{\cdot 2} \mathbb Z \otimes \mathbb Z / 3 \mathbb Z \to \mathbb Z / 2 \mathbb Z \otimes \mathbb Z / 3 \mathbb Z\to 0$$

which is isomorphic to $$0 \to \mathbb Z / 3 \mathbb Z \to \mathbb Z / 3 \mathbb Z \to 0 \to 0$$

which is no longer exact.

-

You could insist that $R$ be local, and then flatness is equivalent to projectiveness.

To thwart $R/I$ from being projective, you would just ensure that $I$ is not a summand of $R$.

So there you have it, a blueprint to find an example. Any commutative local ring with an ideal which is not a summand will work. An obvious choice would be $\mathbb{Z}/(p^2)$ for a prime $p$.

-