If M is a free R module then M×S becomes a free S module of the same rank. This because direct sum and tensor product commute. If S is also free over R, then M×S is a free R module.
Now assume M is the homomorphic image of a free R module F. Tensor F and M with S, and tensor the homomorphism with the identity map on S. Thus M×S is the homomorphic image of a free S module of the same rank. If M was a finitely generated R module then M×S is a finitely generated S module, and its rank is at most the rank of M.
Let M be projective, a summand of F. Write F as the direct product of M and U, and tensor with S, whence M×S is the summand of a free module, and is projective over S.
If M and S are flat, M×S is a flat R module, that happens to be an S module. Tensor this with an exact sequence of S modules, which are all R modules courtesy of the ring homomorphism from R into S. The sequence remains exact when viewed as R modules. The first module embeds, and it is an S module, hence it embeds as an S module. Therefore M×S is a flat S module.
In summary, base change preserves the properties of being free, finitely generated, and projective. It also preserves flatness if S is a flat R module. Since localization is a special form of base change, the same can be said for localizations.
Recall the quotient formula; M×K = M mod HM, where H is the maximal ideal of R. Let b1 b2 b3 … bn be elements of M that become basis elements in M/HM, also known as Kn. This defines a canonical map from the free module F = Rn into M, mapping the generators of F onto the basis elements.
Let C be the cokernal, that is, M mod the image of F. Write an exact sequence like this.
F → M → C → 0
Tensor with K and get this.
Kn → Kn → C×K → 0
The map from F into M was carefully chosen. In particular, the image of F includes the basis elements for Kn. In other words, the first homomorphism in the above sequence is onto, and that means C×K = 0. Using the quotient formula, C equals HC. (Since H acts on M it acts on the quotient module C.) The generators of M span C, so C is finitely generated. Apply nakiama's lemma, and C = 0. Thus F maps onto M.
Let V be the kernel of this map. Remember that M is projective, and one of our criteria says every short exact sequence ending in M splits. Thus F is the direct product of M and V.
Tensor the split exact sequence 0 → V → F → M → 0 with K. The result is split exact, so V×K joins a free module of rank n to give a free module of rank n. As a vector space, the middle module has dimension n, and n+dim(V×K) simultaneously. Therefore V×K = 0. Since V is the quotient of a finitely generated module F, V is finitely generated. Nakiama's lemma shows V = 0, hence F = M. Our finite flat module is free.
The above can be generalized to other rings that may not be local. Let H be a nonzero ideal in the jacobson radical (which lets us use nakiama's lemma), and assume M/HM happens to be a free R/H module. (Note that M is still finite flat over R.) Let K = R/H, realizing that K need not be a field, and apply the above proof. Once again M is free with rank equal to that of M/HM.
There is one tricky part to this generalization - the dimensionality argument that forces V×K = 0. This time K might not be a field. Suppose x is a nonzero element in V×K. Since F×K is free, x generates a copy of K, which is separate from the submodule M×K. Together they span a submodule of rank n+1 inside a free module of rank n. As long as R has a prime ideal, which is assured when R contains 1, this is impossible.
Take a step back and assume S and T are free. Write T as a direct sum of S, and expand each S into a direct sum of R, whence T is a direct sum of R, and a free R module.
Next assume S and T are projective. Let S*V = F, where F is a free R module. Let T*W = Sn. (In this proof, n can be any cardinal number.) Write Fn = Sn*Vn = T*W*Vn. Thus T is the summand of a free R module, and projective over R.
Finally assume S and T are finitely generated. Cross the generators of T, as an S module, with the generators of S, as an R module, to get finitely many generators spanning T as an R module. Put this all together and the composition of finite flat algebras is finite flat.