morphism from a local ring of a scheme to the scheme

Let me add to Amitesh's absolutely correct answer a few words describing the image $I\stackrel {\text {def}}{=}Im(f)$ of the canonical morphism $f:\text{Spec} (\mathcal O_{X,x}) \to X$ .

a) The set $I$ is exactly the intersection of all neighbourhoodz of $x$ in $X$: it is a kind of microgerm of $X$ at $x$.
Beware that $I$ is not a subscheme of $X$ since it is not locally closed.

b) More geometrically (and thus more interestingly!) consider the irreducible subvariety $V=\overline {\lbrace x\rbrace}\subset X$ whose generic point is $x$.
Let $Y\subset X$ be a closed irreducible subscheme on which $V$ lies: $V\subset Y$ and let $\eta_Y$ be the generic point of $Y$.
Then our subset $I$ is exactly the set of all those generic points $\eta_Y$. We say that $I$ is the set of generizations of $x$.

c) Two examples:
1) If $X$ is an irreducible scheme with generic point $\eta$, then for $x=\eta$ we have $I={\lbrace \eta\rbrace}$.
2) If $X=\mathbb A^2_\mathbb C=\text {Spec}(\mathbb C[x,y])$ and $x=(a,b)$ (more accurately $x$ is the maximal ideal $\mathfrak m= (x-a,x-b)$) , then $I$ is the set consisting in $x$, the generic point of $\mathbb A^2_\mathbb C$ and the generic points of all irreducible curves going through $x$, like for example the curve $(y-b)^2-(x-a)^3=0$.


(1) Let $U$ and $V$ be open affine subsets of the scheme $X$ such that $x\in U\cap V$. Choose an open affine subset $x\in W\subseteq U\cap V$. Prove that the compositions $\text{Spec}(O_{X,x})\to W\to U\to U\cup V$ and $\text{Spec}(O_{X,x})\to W\to V\to U\cup V$ are equal to the composition $\text{Spec}(O_{X,x})\to W\to U\cap V\to U\cup V$. (Hint: recall that $U,V,W$ are affine open subsets of $X$ and you understand affine schemes by commutative algebra!)

(2) If $A$ is a commutative ring and if $p$ is a prime ideal, then the spectrum of the localization homomorphism $A\to A_{p}$ is the map $\text{Spec}(A_p)\to \text{Spec}(A)$. The image of this map equals the set of all prime ideals of $A$ contained in $p$ (prove this fact from commutative algebra if it is not obvious).