I don't know how your book defines the ring of fractions, but the right (i.e. the most general as possible) way of doing things with rings of fractions is this :
If $M$ is an $R$-module and $1 \in D \subseteq R$ is a subset of $R$ which is multiplicatively closed, then we define $D^{-1} R$ as follows. Define the following equivalence relation over $D \times M$ : $(d_1, m_1) \sim (d_2, m_2)$ if there exists $d \in D$ such that $d(d_1 m_2 - d_2 m_1) = 0$. You can check that this defines an equivalence class over $D \times M$ (the details are okay to work out, nothing hard), and in the case where $M = R$ and $R$ is an integral domain, you can get rid of the condition 'there exists a $d \in D$ such that' because it is not necessary.
Defining the addition as usual over $D^{-1} M$, this makes $D^{-1}M$ into an abelian group. In particular, since $R$ is an $R$-module over itself, we can define $D^{-1}R$. Considering the particular case of $D^{-1}R$ alone first, we can define multiplication as $\frac{r_1}{d_1} \frac{r_2}{d_2} = \frac{r_1 r_2}{d_1 d_2}$. This makes $D^{-1}R$ into a ring, so now we can say that the scalar multiplication $\frac{r}{d} \frac{m}{d'} = \frac{rm}{dd'}$ makes $D^{-1}M$ into a $D^{-1}R$-module.
(I used the letter $D$ because it stands for denominators. The letter $S$ is probably just used because of the alphabet...)
In this kind of generality, if you want to make $D^{-1}R$ into an integral domain, you need to make some assumptions on $D$. For instance,
Note that the set $D$ of all non-zerodivisors is a multiplicatively closed subset of $R$ which contains $1$. This means that if $\frac a1 = \frac b1$, there exists $d \in D$ such that $d(a-b) = 0$, but $d$ is not a zero-divisor, then $a-b =0$ and $a=b$, hence the remark that $f$ is a monomorphism in this case. If $D$ contains a zero divisor, you can have some fraction $\frac r1 = \frac 01$ without having $r=0$, because this equation only means that there exists $d \in D$ such that $rd = 0$. The equivalence class of $\frac 01$ contains precisely those $r \in R$ that are zero divisors.
In an integral domain, there are no zero-divisors, so by the above remark the map $f$ is an embedding of $R$ into its quotient field $D^{-1}R$ (where $D$ is the set of non-zero elements, which is also the set of non-zero divisors in this case). Note that $D^{-1}R$ is a field because a fraction $\frac rd$ is never equivalent to $\frac 0{d'}$ for some $d'$, hence we can take its inverse to be $\frac dr$.
Hope that helps! Feel free to ask any questions about the details.