Is it enough to check closed immersion at closed points? 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?
 A: Here's my approach: suppose $f: X \to Y$ is morphism of varieties, and assume additionally that $X$ is Noetherian (i.e. admits a finite cover with affine varieties). Then $f$ is quasicompact and quasiseparated, so $f_* \mathcal{O}_X$ is a quasicoherent $\mathcal{O}_Y$ module, and $f$ induces a map of quasicoherent $\mathcal{O}_Y$ modules $\mathcal{O}_Y \to f_* \mathcal{O}_X$, and let $\mathcal{F}$ be the (quasicoherent) cokernel. 
Consider any closed $y = f(x)$ in $Y$. Then, we have induced map $\mathcal{O}_{Y,f(x)} \to (f_* \mathcal{O}_X)_{f(x)} \simeq \mathcal{O}_{X,x}$. Since by assumption it's surjective, the stalk of the cokernel $\mathcal{F}_{f(x)}$ is zero, thus $\mathcal{F}|_V = 0$ for some neighbourhood of $f(x)$. Since closed points are dense in $X$, and $f$ is closed immersion, they're also dense in the image $f(X)$, so the cokernel $\mathcal{F}$ is zero in some open neighbourhood of $f(X)$. Outside of $f(X)$ it's trivially 0, as $(f_* \mathcal{O}_X)_y = 0$ for $y$ outside $f(X)$ (since $f(X)$ is closed). We conclude that $\mathcal{F} = 0$, and so $\mathcal{O}_Y \to f_* \mathcal{O}_X$ is epimorphism of sheaves.
Now, if we could prove that $f$ is affine morphism, it would remain to prove that for any affine $\mathrm{Spec} A \subset Y$, $\mathcal{O}_Y(\mathrm{Spec} A) \to f_* \mathcal{O}_X(\mathrm{Spec} A)$ is a surjective ring map, but this is obvious since $\mathcal{O}_X$ and $f_* \mathcal{O}_Y$ are quasicoherent, and $\mathcal{O}_Y \to f_* \mathcal{O}_X$ is surjective.
Does $f$ need to be affine, though? I don't know.
A: 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.
