Solution (source code)

= Solution

For an <affine open subscheme> $U=\operatorname{Spec}R$, <quasi-coherence> gives $\mathcal I|_U=\widetilde J$ for an <ideal> $J\subseteq R$. Define $Z_U=\operatorname{Spec}(R/J)$ with its usual <closed immersion> into $U$. On a <principal open subscheme> $D(a)$, its restriction is $\operatorname{Spec}(R_a/J_a)$, because <localization> commutes with taking this quotient. These local constructions therefore agree on overlaps and glue.

The resulting underlying closed set is $Z=\{x:\mathcal I_x\ne\mathcal O_{X,x}\}$, locally $V(J)$. With inclusion $i:Z\hookrightarrow X$, its <structure sheaf> is
$$
\boxed{\mathcal O_Z=i^{-1}(\mathcal O_X/\mathcal I),\qquad
i_*\mathcal O_Z=\mathcal O_X/\mathcal I.}
$$
At a point corresponding to $\mathfrak p\supseteq J$, its <stalk> is $R_{\mathfrak p}/J_{\mathfrak p}$, the <local ring> of $\operatorname{Spec}(R/J)$. Thus the glued ringed space is a <scheme> and $i$ is a closed immersion, with <ideal sheaf of a closed subscheme> exactly $\mathcal I$. This is the <construction of a closed subscheme from a quasi-coherent ideal>. If $\mathcal I=\mathcal O_X$, the construction gives the empty scheme; if $\mathcal I=0$, it gives $X$.