I’m taking an introductory course on Scheme theory. In one of the proofs of the course, we were considering a situation where we have a morphism of schemes $f: \operatorname{Spec} R \to X$, where $X$ is a scheme and $R$ is a local ring of maximal ideal $\frak{m}$.
Then, if $y_0 \in \operatorname{Spec} R$ is the point corresponding to the maximal ideal $\frak{m}$, the proof says that if $f(y_0)$ is contained in an open set $U \subset X$, then it follows that $f(\operatorname{Spec} R) \subset U$.
I must be missing something obvious (assuming I took notes correctly) but I don’t see the reason for this claim… I guess I should use that $y_0$ is the only closed point in $\operatorname{Spec} R$, but I don’t know how.
Suppose $U\subset X$ is an open set containing $f(y_0)$. Then $f^{-1}(U)$ is an open set in $\operatorname{Spec} R$ which contains $y_0=V(\mathfrak{m})$. I claim such an open subset must be the whole of $\operatorname{Spec} R$.
Let $Z\subset X$ be the closed complement of $f^{-1}(U)$. Then we may write $Z=V(I)$ as sets for some ideal $I\subset R$. Since every proper ideal is contained in a maximal ideal, if $I$ were proper we'd have $I\subset\mathfrak{m}$, or $\{y_0\} = V(\mathfrak{m})\subset V(I)$ (as sets). But this does not happen, so $I$ is the unit ideal, or $V(I)=\emptyset$, and $f^{-1}(U)=\operatorname{Spec} R$.