In chapter 3 of Atiyah and Macdonalds Intro to Comm Algebra there is the statement
"We also have a ring homomorphism $f:A\rightarrow S^{-1}A$ defined by $f(x)=x/1$. This is not in general injective." (Note: $A$ denotes an integral domain and $S$ a multiplicatively closed subset of $A$.)
How could this possibly not be injective? If $f(x)=f(y)$ then $x/1=y/1$ so $1x=1y$ hence $x=y$. What am I missing here?
EDIT: The answer below the line assumes $A$ is just a ring. In case $A$ is an integral domain, that answer of course does not apply, and your reasoning is right . . .
. . . assuming $S$ doesn't contain $0$. If $0\in S$, then $S^{-1}A$ is the trivial ring, and $f$ is extremely not injective.
The localization is a bit more complicated than you're giving it credit for.
The general definition of the localization $S^{-1}A$ is as follows: elements are equivalence classes of pairs $(r, s)$ with $r\in A$ and $s\in S$ (thought of as meaning "${r\over s}$"), under the equivalence relation $$(r_1, s_1)\sim (r_2, s_2)\iff \mbox{ there is some $t\in S$ such that }t(r_1s_2-r_2s_1)=0.$$
Now suppose $a, b\in R$ and $s\in S$ are such that $s(a-b)=0$. Then $(a, 1)\sim (b, 1)$! But this can happen even if $a\not=b$ - e.g. working in $\mathbb{Z}/6\mathbb{Z}$, let $S=\{1, 2, 4\}$, $s=2$, $a=4$, $b=1$.
It sounds like your thinking of the much simpler relation $$(r_1, s_1)\approx (r_2, s_2)\iff r_1s_2=r_2s_1.$$ Why don't we use that instead?
Well, it's not necessarily transitive! If $(r_1, s_1)\approx (r_2, s_2)\approx (r_3, s_3)$, then we know that
and we want to conclude that
But we can't do this in general. E.g. in $\mathbb{Z}/12\mathbb{Z}$, we have $$(3, 2)\approx (6, 4)\approx (6, 6)$$ but $$(3, 2)\not\approx (6, 6)$$ (since $6\cdot 3=18=6\not=0=6\cdot 2$).