Let f be a ring homomorphism on R, and let S be a multiplicatively closed set in R. This implies a fraction ring R/S, and an induced function from R/S into f(R)/S. In our earlier example, f was R/M, and f induced a map from R/S into (R/M)/S. This became an isomorphism. The residue field was unchanged by localization.
Let the kernel of f be a prime ideal P, and let S be disjoint from P. We will show that S inverse of P is the kernel of the induced homomorphism. One direction is obvious. If f(x) = 0 then f(x/u) = f(x)/u = 0/u is a fraction that is equivalent to 0. For the converse, let f(x/u) = f(x)/u = 0/1. Something in f(S) kills f(x). Write f(x)*f(v) = 0. Thus f(xv) = 0. Since xv lies in P, either x or v is in P. Yet v is outside of P, hence x is in P. The kernel of the localization of f is the localization of the kernel of f.
It is common to set S = R-P, and f = R/P. Thus R/S = RP, i.e. the localization about P. By correspondence under a ring homomorphism, the prime ideals in f(R)/S come from prime ideals in R/S that contain the kernel, which is P/S. By correspondence under localization, these come from the prime ideals of R containing P and missing S. There is only one such ideal, namely P. Thus there is but one prime ideal in the image, namely 0, and the image is a field. The localized quotient, or the quotient of the localizations, is a field, which is called the residue field.
This is not particularly surprising, since we are dividing a local ring RP by its maximal ideal. The field is sometimes denoted KP.
Note that KP is a cyclic RP module, with 1/1 as generator.
To simplify notation, let R be the localization of Z about p. Thus R is already a local ring. Let M be the maximal ideal generated by p. Tensor the following sequence with K = R/M.
0 → M → R → K → 0
The middle module becomes K, and remembering the quotient formula, the third module becomes K mod MK, which is K. To be flat, M*K has to equal 0. This means M mod MM = 0, or MM = M. The ideal generated by p2 is not the ideal generated by p, thus our residue field is not flat.