Suppose $\iota: X \hookrightarrow Y$ is an open embedding of schemes. We can assume $X$ is an open subscheme of $Y$.
On the level of sets, $\iota$ is injective.
I wish to see that the pullback map $\iota^\sharp: \mathcal O_Y \to \mathcal O_Y|_X$ is injective.
I don't see how this is always true.
For example, if we take a ring $A$ which is not a domain, then the localization (restriction) map $A \to A_f$ is not always injective.
Doesn't this show that open embedding are not always monomorphisms?
If not, where is the error?
Let's recap the discussion from the comments and provide a full solution to the problem.
First, we'll fix the definition of an open immersion: a map $f:X\to Y$ is an open immersion of locally ringed spaces if and only if $f$ is a homeomorphism of $X$ on to an open subset of $Y$ and the pullback map $f^{-1}\mathcal{O}_Y\to \mathcal{O}_X$ is an isomorphism (ref 01HE). This is the standard way to talk about "the pullback morphism", and I'm emphasizing it because you apply the adjunction between $(-)^{-1}$ and $(-)_*$ to write it a different way, where the map is no longer an isomorphism but instead an isomorphism over the image of $f$ and zero elsewhere.
Next, we'll address your confusion about $A\to A_f$. In order to verify that the stalks of $\mathcal{O}_{\operatorname{Spec} A}$ and $\mathcal{O}_{\operatorname{Spec} A_f}$ are the same for all points in $\operatorname{Spec} A_f$, let's remember what those points are. There is a bijection between prime ideals of $A_f$ and prime ideals of $A$ not meeting $f$, so suppose we have a prime ideal $\mathfrak{p}\subset A$ not meeting $f$ which gives a prime ideal $\mathfrak{p}_f\subset A_f$. Then the stalk of $\mathcal{O}_{\operatorname{Spec} A}$ at $\mathfrak{p}$ is $A_\mathfrak{p}$, while the stalk of $\mathcal{O}_{\operatorname{Spec} A_f}$ at $\mathfrak{p}_f$ is $(A_f)_{\mathfrak{p}_f}$. But since localization is transitive and $f\notin \mathfrak{p}$ by assumption, $(A_f)_{\mathfrak{p}_f}\cong A_\mathfrak{p}$ and the stalks are the same as requested.