I was trying to do the construction of the structure sheaf of $\operatorname{Spec}A$ by myself when I encountered a difficulty.
To do this I plan to construct the sheaf on a basis of $SpecA$ and then make the canonical extension. The problem comes with the restriction maps. Let $\mathcal{O}_A$ denote the structure sheaf. Then $\mathcal{O}_A(D(f))=A_f$.
If $D(f) \subset D(g)$ I want to find an homomorphism $A \xrightarrow{\varphi} A_f$ sending $g$ to an unity and then use the universal property of the localization to get a morphism between localizations.
My problem is that I just know that $rad(g) \subset rad(f)$ and I think is not enough to find the desired $\varphi$. What can I do?
Just use the obvious map $\varphi(a) = a/1$. Indeed, if $\varphi(g)$ is not a unit in $A_f$, then there is a prime ideal $p$ in $A_f$ containing $g/1$. Its preimage $q = \varphi^{-1}[p]$ is a prime ideal of $A$ which contains $g$ but not $f$ (if $f\in q$, then $f/1\in p$, but $f/1$ is a unit in $A_f$, so $p$ is not prime). This contradicts $D(f)\subseteq D(g)$.