# Bijection Between Morphisms of Schemes and Local Ring Homomorphisms

Let $$R$$ be a local ring with maximal ideal $$\mathfrak{m}$$ and let $$(X, \mathcal{O}_X)$$ be a scheme.

I want to show that there is a bijection:

\begin{align} & \quad \{ (f, f^\#) \in \mathrm{Hom}(\operatorname{Spec}(R), X) \mid f(\mathfrak{m}) = x \} \\ \longleftrightarrow & \quad \mathrm{Hom}_{\text{local ring}}(\mathcal{O}_{X, x}, R)\\ \end{align}

So far, I have found maps in both directions (detailed below), but am stuck on showing that these are injective (either directly, or by showing that they are mutual inverses).

Specifically, given $$(f, f^\#)$$, we have an induced local ring homomorphism, $$f^\#_\mathfrak{m}: \mathcal{O}_{X, x} \rightarrow \mathcal{O}_{\operatorname{Spec}(R), \mathfrak{m}} \cong R_{\mathfrak{m}} \cong R$$.

In the other direction (for the case that $$X = \operatorname{Spec}(S)$$ is an affine scheme), suppose we have $$\varphi: \mathcal{O}_{X, x} \cong S_x \rightarrow R$$. Since this is a local homomorphism, $$\varphi^{-1}(\mathfrak{m}) = x \cdot S_x$$, the maximal ideal in $$S_x$$. This induces a homomorphism

$$S \xrightarrow{\ell_x = \text{localization}} S_x \overset{\varphi}{\longrightarrow} R$$

and hence, $$(\varphi \circ \ell_x)^{-1}$$ is a map from $$\operatorname{Spec}(R)$$ to $$\operatorname{Spec}(S) = X$$ with $$(\varphi \circ \ell_x)^{-1}(\mathfrak{m}) = x$$, as required .

[And in the case that $$X$$ is not affine, we just do the same thing with an affine neighbourhood of $$x$$. Reducing from the general case to the affine case seems to be straightforward when showing injectivity as well...]

What I am struggling with is showing that the above maps are indeed injective (or, even better, mutually inverse) even in just the affine case. I have just started learning about schemes, so my knowledge is a bit limited, and whilst more abstract explanations may be useful, I might find more 'concrete' explanations a bit easier to understand.

From the map $$g :=(\varphi \circ l_x)^{-1}: \mbox{Spec}(R) \to \mbox{Spec} (S)$$ we know that $$g^{\#}(\mbox{Spec} (S))= \varphi \circ l_x$$, so we have the induce map $$g^{\#}_x : S_x \to R_{\mathfrak{m}} = R$$ which is just $$(\varphi \circ l_x)_{x} = \varphi$$.
Let $$(f,f^{\#}) : \mbox{Spec}(R) \to \mbox{Spec} (S)$$ and from your construction we have the local morphism $$f^{\#}_{\mathfrak{m}} : S_x \to R$$. Now we can construct $$g = (f^{\#}_{\mathfrak{m}} \circ l_x)^{-1} : \mbox{Spec}(R) \to \mbox{Spec} (S)$$. We know that $$f= f^{\#}(\mbox{Spec} (S))^{-1}$$, so we have for every $$\mathfrak{p} \in \mbox{Spec} (R)$$, $$(f^{\#}_{\mathfrak{m}})^{-1}(\mathfrak{p}) = f(\mathfrak{p}) S_x$$. From this $$g = f$$.