I have the following questions:
Let $S$ be a commutative ring and let $M,N$ be closed subspaces of $\mathrm{Spec}(S)$ such that $M\cap N=\emptyset$.
1) Why are there ideals $I_1,I_2\unlhd S$, such that $M\cong\mathrm{Spec}(S/I_1)$, $N\cong\mathrm{Spec}(S/I_2)$ and $I_1+I_2=S$?
2) Why is it possible for every $h\in \widetilde{S}(M)$ to find some $h'\in S$, such that $h'\big|_{M}=h$ and $h'\big|_{N}=0$?
Here, $\widetilde{S}$ denotes the étalé space belonging to $S$ and $f\mapsto f\big|_{M}$ denotes the restriction of intersections in the étalé space belonging to $\widetilde{S}$.
Note that $\widetilde{S}$ is a sheaf.
Thanks for the help!
1) Recall the definition of the Zariski topology, and that there's a natural bijection $$\{\text{prime ideals of $S$ containing $I$}\}\longleftrightarrow\{\text{prime ideals of $S/I$}\}$$ Lastly, observe that $\varnothing=M\cap N = V(I_1)\cap V(I_2)=V(I_1+I_2)$ is equivalent to saying that there are no prime ideals of $S$ containing $I_1+I_2$. But every proper ideal is contained in at least one maximal ideal, so $I_1+I_2$ can't be proper, so $I_1+I_2=S$.
2) Now that you've shown $I_1+I_2=S$, the Chinese remainder theorem implies that you can find an element $h'\in S$ with $$\begin{align*} h'&\equiv h\bmod I_1\\ h'&\equiv 0\bmod I_2 \end{align*}$$