TITLE: Is it enough to check closed immersion at closed points?
QUESTION [9 upvotes]: Let $f \colon X\to Y$ be a morphisms of algebraic varieties, which is a closed immersion in the topological sense. We also know that $f_x\colon \mathcal O_{Y,f(x)}\to \mathcal O_{X,x}$ is surjective for every closed point $x \in X$.
Can we conclude that $f$ is a closed immersion?

REPLY [3 votes]: Let $I \subseteq \mathcal{O}_Y$ be the kernel of $f^\# : \mathcal{O}_Y \to f_* \mathcal{O}_X$ (this is quasi-coherent since $f$ is qc qs). Then $f$ factors as $X \to V(I) \hookrightarrow Y$ and we want to show that $f' : X \to V(I)$ is an isomorphism. Notice that $f'$ is a closed immersion in the topological sense and that $f'$ induces isomorphisms on the stalks at closed points. It is a general result that $f'$ has dense image (Tag 01R8)
, so that in our case $f'$ is a homeomorphism. Thus, it suffices to prove:

Let $f : X \to Y$ be a morphism of algebraic varieties, which is a homeomorphism, and such that $f_x : \mathcal{O}_{f(x)} \cong \mathcal{O}_{x}$ is an isomorphism for every closed point $x \in X$. Then this is true for every $x \in X$, and hence $f$ is an isomorphism.

Consider the homomorphism of quasi-coherent $\mathcal{O}_Y$-modules $f^\# : \mathcal{O}_Y \to f_* \mathcal{O}_X$. It is an isomorphism at every closed point of $Y$. Thus, it suffices prove:

Let $X$ be an algebraic variety, $\phi : M \to N$ be a homomorphism of quasi-coherent $\mathcal{O}_X$-modules, which is an isomorphism at every closed point of $X$. Then $\phi$ is an isomorphism.

By considering the cokernel and the kernel of $\phi$, it suffices to prove:

Let $X$ be an algebraic variety and $M$ be a quasi-coherent $\mathcal{O}_X$-module, which vanishes at every closed point of $X$. Then $M=0$.

Proof: If $M$ is coherent, and $M \neq 0$, then $\mathrm{supp}(M)$ is a non-empty closed subset of $X$, so that it must contain a closed point of $X$, a contradiction. If $M$ is arbitrary, we can write $M$ as a sum of coherent modules and apply the coherent case.