I’m taking an introductory course on Scheme theory. In one of the proofs of the course, we were considering all morphisms of schemes $f: \operatorname{Spec} R \to X$, where $X$ is a scheme and $R$ is a local ring of maximal ideal $\frak{m}$. (Let's call $\{y_0\}=V(\mathfrak{m})$ the closed point associated to that maximal ideal.)
In the proof, this is written as follows:
$$\operatorname{Hom}_{Sch}(\operatorname{Spec}R,X)=\{ (x,\phi), \text{ where } x\in X \text{ and } \phi:\mathcal{O}_{X,x} \rightarrow R \text{ is a local morphism} \}$$
I'm trying to understand why. Here are my thoughts in case it's helpful to see where my confusion stems from (you might ignore them if they're incorrect):
I know that in general, a morphism of schemes $(Y,\mathcal{O}_Y) \rightarrow (X,\mathcal{O}_X)$ is a morphism of ringed spaces $(f,f^\flat)$ such that for all $y \in Y$ the induced homomorphism on stalks $f^{\sharp}_y: \mathcal{O}_{X,f(y)} \rightarrow \mathcal{O}_{Y,y}$ is a local ring homomorphism. In our case, I can see that the morphism $\phi$ given in the proof corresponds to $f^\sharp_y:\mathcal{O}_{X,f(y)} \rightarrow \mathcal{O}_{\operatorname{Spec}R,y}$ for some continuous map $f:\operatorname{Spec}R\rightarrow X$ and some $y\in \operatorname{Spec}R$. Since they wrote $R$ as the codomain of $\phi$, I deduce that they're considering that $y=y_0$ is the closed point in $R$, because then $\mathcal{O}_{\operatorname{Spec}R,y}=R_{\mathfrak{m}}=R$ (since $R$ is local).
So what I understand they mean is that
$$\operatorname{Hom}_{Sch}(\operatorname{Spec}R,X)=\{ (f(y_0),f_{f(y_0)}^{\flat}), \text{ where }f_{f(y_0)}^{\flat} : \mathcal{O}_{X,f(y_0)}\rightarrow R\}$$
...but this seems to imply that any morphism of schemes $f: \operatorname{Spec} R \to X$ is determined uniquely by the image of the closed point by the underlying map (and it's induced homomorphism on the stalk at the image of that point). If that's correct, I don't see the reason.