TITLE: Example of morphism of ringed spaces not induced by homomorphism of rings
QUESTION [6 upvotes]: What is the example of non-local morphism of ringed spaces $\phi:\text{Spec}(B)\to\text{Spec}(A)$, which is not induced by the ring homomorphism $A\to B$?
Thank you.

REPLY [6 votes]: The standard example, II.2.3.2 in Hartshorne, is to consider a DVR $A$ (take $A = \mathbb{C}[t]_{(t)}$ for concreteness, if you like) with fraction field $K$. You can define a morphism of ringed spaces $\operatorname{Spec} K \to \operatorname{Spec} A$ whose image is the closed point. The map of local rings there is just the inclusion $A \subset K$.