# Local to global flatness question

This is a bit of a bizzare question, but I'm going to ask it anyway.

If $X={\rm Spec}R$ is an affine variety, and $\mathfrak{m}$ a closed point, then the localization $R\to R_{\mathfrak{m}}$ gives a morphism

$f:{\rm Spec}R_{\mathfrak{m}}\to{\rm Spec}R$,

yielding an adjunction between ${\rm Qcoh} R$ and ${\rm Qcoh} R_{\mathfrak{m}}$. This is just a very long-winded way of saying localization and extension of scalars between module categories. Note that $f_*(R_{\mathfrak{m}})$ is flat as an $R$-module, since localization is exact.

I'm wondering if this just generalizes as is to the scheme world. Take a scheme $X$ (with nice properties as you like, if necessary), and a closed point $x\in X$. We still have a map

$f:{\rm Spec }\mathcal{O}_{X,x}\to X$,

given as factorization through an open affine. Is $f_*(\mathcal{O}_{X,x})$ flat as a $\mathcal{O}_X$-module? I can see that it is flat at all points $y$ for which $x$ and $y$ both live in a common open affine (basically by above), but does this extend to all points? Morally, I'd like to think so, but I can't write down a proof.

-
It seems to me that you're saying your map factors through an open affine $U \subset X$ such that the map to $U$ is flat. But open immersions are flat and a composition of flat maps is flat, so that would seem to do it. – Mike Skirvin Jun 3 '11 at 16:35
@Mike: This argument is not quite correct, see the link to the counterexample in Lei's answer. – Martin Brandenburg Jun 4 '11 at 9:13

This is of course true, for any semi-separated scheme (i.e. the diagonal is affine), or maybe you assume $X$ is separated if you like, and you can take any point (not necessarily closed). The reason that the sheaf is flat is that ${\rm Spec}(O_{X,x})\to X$ is affine and flat. In general if $f: X\to Y$ is flat and affine then $f_*O_X$ is $O_Y-$flat. This is obvious.
But I don't think it is true that $f: X\to Y$ is flat implies $f_*O_X$ is $O_Y-$flat. See link text