On a bijection between isomorphism Spec $A$ $\rightarrow$ Spec $A'$ and the ring isomorphism $A \rightarrow A'$. Let $A$ and $A'$ be commutative rings with unity. Suppose I have an isomorphism of affine schemes, say: $\pi:$ Spec $A$ $\rightarrow$ Spec $A'$
and $\alpha: O_{Spec A'} \rightarrow \pi_* O_{Spec A}  $. How can I show that
the map $\pi$ is the same as the $\phi^{-1}$, where $\phi = \alpha(D(1))$, the 
induced map on the global sections. (This is part of an exercise to show there is a 
bijection between isomorphism Spec $A$ $\rightarrow$ Spec $A'$ and the ring isomorphism $A \rightarrow A'$.) Thanks!
 A: The canonical map $\hom(A',A) \to \hom(\mathrm{Spec}(A),\mathrm{Spec}(A'))$ is bijective - this is shown in every text on affine schemes. There is no need to restrict to isomorphisms.
Proof. Let $\pi: \mathrm{Spec}(A) \to \mathrm{Spec}(A')$ be a morphism of schemes, $\phi : A' \to A$ the induced ring homomorphism on global sections. Let $\mathfrak{p} \in \mathrm{Spec}(A)$ and $\mathfrak{q} := \pi(\mathfrak{p})$. The map on stalks $\mathcal{O}_{\mathrm{Spec}(A'),\mathfrak{q}} \to \mathcal{O}_{\mathrm{Spec}(A),\mathfrak{p}}$ is local and identifies with a ring homomorphism $A'_\mathfrak{q} \to A_\mathfrak{p}$ which makes
$$\begin{array}{c} A' & \xrightarrow{\phi} & A \\ \downarrow && \downarrow \\ A'_\mathfrak{q} & \rightarrow &  A_\mathfrak{p}  \end{array}$$
commutative. Pulling back the maximal ideal of $A_\mathfrak{p}$ to a prime ideal of $A'$, we get $\mathfrak{q}=\phi^{-1}(\mathfrak{p})$.
A similar diagram involving localizations at elements shows that the sheaf portion of $\pi$ agrees with that of $\phi^{-1} : \mathrm{Spec}(A) \to \mathrm{Spec}(A')$.
