The question is right,isn't it? Actually,see an exercise (2.18b) of chap.2 of algebraic geometry by Hartshorne.Given a ring homomorphism $f:A \to B$,let $g:SpecB \to SpecA$ be the induced morphism.Then f is injective iff the map of sheaves$g^\sharp:O_{SpecA} \to g_*O_{SpecB}$ is injective.Note that $g^\sharp $ is injective iff for any $ a \in A$,$ g^ \sharp(D(a)):O_{SpecA}(D(a)) \to g_*O_{SpecB}(D(a))$ is injective i.e. for any $ a \in A$,$ g^ \sharp_a:A_a \to B_{f(a)}$ is injective .So the question becomes f is injective iff $g^\sharp_a$ is injective for any $a\in A$.The proof as follows: "if"part,assume $g^\sharp $ is injective,taking global section (note that taking global functor is left exact) we have $f:A \to B $ is injective."only if"part,if $f:A \to B $ is injective ,and $g^\sharp_a(c/a^n)=f(c)/f(a^n)=0 \in B_{f(a)}$,then there exists some intrger $m$ such that $ f(c)f(a)^m=0$ which implies $ f(ca^m)=0 $,since f is injective, $ ca^m=0$, so $c/a^n=0$.Q.E.D.By this conclusion, a ring homomorphism f is injective iff for any $p\in SpecB$,the induced map $g^\sharp_p:O_{SpecA,f^{-1}(p)} \to O_{SpecB,p}$ is injective.In the language of category,this fact states that since the category of affine schemes is equivalent to the opposite category of the category of commutative rings with identity,so injectivity of ring homomorphisms is equivalent to injectivity of morphisms of affine schemes,note that injectivity of morphisms of sheaves is equivalent to injectivity of morphisms of sheaves on stalks,hence the result is not strange.