TITLE: Can a quotient ring R/J ever be flat over R?
QUESTION [25 upvotes]: If R is a ring and J⊂R is an ideal, can R/J ever be a flat R-module? For algebraic geometers, the question is "can a closed immersion ever be flat?"
The answer is yes: take J=0. For a less trivial example, take R=R1⊕R2 and J=R1, then R/J is flat over R. Geometrically, this is the inclusion of a connected component, which is kind of cheating. If I add the hypotheses that R has no idempotents (i.e. Spec(R) is connected) and J≠0, can R/J ever be flat over R?
I think the answer is no, but I don't know how to prove it. Here's a failed attempt. Consider the exact sequence 0→J→R→R/J→0. When you tensor with R/J, you get

0→ J/J2→R/J→R/J→0

where the map R/J→R/J is the identity map. If J≠J2, this sequence is not exact, contradicting flatness of R/J.
But sometimes it happens that J=J2, like the case of the maximal ideal of the ring k[tq| q∈Q>0]. I can show that the quotient is not flat in that case (see this answer), but I had to do something clever.
I usually think about commutative rings, but if you have a non-commutative example, I'd love to see it.

REPLY [10 votes]: Just a small point.  There are rings over which every module is flat.  These are the absolutely flat rings in the checked answer above, but they are also called von Neumann regular rings.  An infinite product of fields is the standard example of a commutative von Neumann regular ring that is not semisimple.  But there are lots and lots of noncommutative von Neumann regular rings.   Note that a Noetherian von Neumann regular ring is semisimple, but every von Neumann regular ring is coherent.