You should along with Z, choose the multiplicative subset you want to do localization with.
Perhaps an intuitive example is the construction of the quotient field Q.
First, we know that \frac{8}{2}= \frac{4}{1}, i.e the two are equivalent since 8 * 1 - 4*2 = 0. We also need to be careful not to have the denominator be zero!
We may think of \frac{8}{2} as a pair (8,2) in Z \times S, where S is Z with zero removed. In order to deal with the fact that two different fractions could be equal, like (8,2) = (4,1), it is better to consider these "equal" fractions as fractions belonging to the same equivalence class.
So we define a relation \equiv as follows (z_1, s_1)\equiv (z_2, s_2) if and only if z_1 s_2 - s_1 z_2 = 0.
Now we may consider the set of all equivalence classes, i.e the quotient of Z \times S by the relation \equiv. Let us denote that by Q (this is the localization of Z with respect to S, usually denoted by S^{-1}Z, in our case, since Z is a domain, and we considered the multiplicative set to be Z - {0}, it is called the field of fractions).
It remains to define multiplication and addition.
Similar to the high-school definition of addition of fractions \frac{z_1}{s_1} + \frac{z_2}{s_2} = \frac{z_1 * s_2 + z_2 * s_1}{s_1 * s_2}, define addition as
(z_1, s_1) + (z_2, s_2) = (z_1 * s_2 + z_2 * s_1, s_1 * s_2).
and multiplication
(z_1, s_1) * (z_2, s_2) = (z_1 z_2, s_1 s_2)
The quotient we defined turns out to be a field, moreover, there's a (an injective) canonical ring homomorphism, i: Z -> Q[/itex] defined by x -&gt; (x,1), i.e intuitively every integer n in Z is a rational number \frac{n}{1} i.e corresponds to a pair (n,1) in Q = (Z \times S) / \equiv.<br />
<br />
<br />
Here's another localization on Z. Naively speaking, a subset of Q in which the denominator is not divisible by a prime.<br />
<br />
Let p be a prime number. Now pZ is a prime ideal. Let S = Z - pZ (i.e the integers with the ideal pZ removed). It is a multiplicative set.<br />
Do localization as above, define an equivalence relation \equiv by (z_1, s_1) \equiv (z_2, s_2) iff z_1 s_2 - s_1 z_2 = 0 for z_1, z_2 in Z, and s_1, s_2 in S = Z - pZ. Define addition and multiplication as above.<br />
<br />
The (quotient) ring obtained Z_{pZ} = (Z \times Z - pZ) / \equiv is the "localization of Z at p".<br />
<br />
Each element (a,b) in Z_{pZ} corresponds to an element in Q (i.e in (Z \times Z - {0}) / \equiv, but the prime p we chose doesn't divide b. <br />
<br />
<br />
<br />
<br />
Actually localization allow us to consider rings that are not domains, but in order to do so we must modify the definition of the equivalent relation above by requiring the existence of an element s_3 in the multiplicative set S, so that instead of z_1 s_2 - s_1 z_2 = 0, it would be s_3 ( z_1 s_2 - s_1 z_2) = 0. But addition and multiplication is defined as above! The canonical ring homomorphism defined earlier is no more injective, and we can't form a field of fraction(the case where we have a domain, and consider the multiplicative set to be that domain with zero removed, as we did for Q!) !<br />
<br />
Still though, if you have a set A that is not a domain. You may consider the multiplicative set S which consists of all non-zero divisors of A. You may then (similar to arguments above) construct "the total ring of fractions".