Lemma 66.21.6. Let $S$ be a scheme. A quasi-compact and quasi-separated morphism of algebraic spaces $f : Y \to X$ is quasi-affine if and only if the canonical factorization $Y \to \underline{\mathop{\mathrm{Spec}}}_ X(f_*\mathcal{O}_ Y)$ (Remark 66.20.9) is an open immersion.

Proof. Let $U \to X$ be a surjective morphism where $U$ is a scheme. Since we may check whether $f$ is quasi-affine after base change to $U$ (Lemma 66.21.3), since $f_*\mathcal{O}_ Y|_ V$ is equal to $(Y \times _ X U \to U)_*\mathcal{O}_{Y \times _ X U}$ (Properties of Spaces, Lemma 65.26.2), and since formation of relative spectrum commutes with base change (Lemma 66.20.7), we see that the assertion reduces to the case that $X$ is a scheme. If $X$ is a scheme and either $f$ is quasi-affine or $Y \to \underline{\mathop{\mathrm{Spec}}}_ X(f_*\mathcal{O}_ Y)$ is an open immersion, then $Y$ is a scheme as well. Thus we reduce to Morphisms, Lemma 29.13.3. $\square$

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).