If S contains 1, map x/1 to f(x)/1. If S does not contain 1, map wx/w to wf(x)/w. This is the same as f(wx)/w. In other words, apply f to each numerator and carry the denominator along. Verify this map, (call it g), respects addition and scaling in R/S.
The homomorphism is well defined only if 0 maps to 0. The numerator x, in the fractions U/S, is 0 only if something in S kills x. Write dx = 0 and apply f. Now df(x) = 0, and f(x) becomes 0 in V/S. Thus g is a valid R/S module homomorphism.
Assume S kills nothing in V, and assume f(x) = 0 only if something in S kills x in U. Start with 0 in V/S and work backwards to show the preimage is 0. Thus g is injective.
A similar form of reverse engineering establishes criteria for surjective. If every z in V has some x in U such that z-f(x) is killed by something in S, then g is onto.
Multiply fractions in the usual way, and verify that V/S is a ring. Also, the map from U/S onto V/S is a ring homomorphism. The fraction x/y is in the kernel if f(x), acted on by some z in S, yields 0. Thus f(xz) = 0, and zx lies in H, and x is in the saturation of H. If H is already saturated then x has to be in H, and x/y was already 0. Surjective is easy, hence the ring is isomorphic to the fractions of R/H by S. We can localize or reduce mod H in either order, as we please.
Apply this map to the composition of two successive functions, and the result is the same as the composition of the individual localizations. Either way the numerator is mapped to f2(f1(x)).
Use the above to build a ring homomorphism from the endomorphisms of M into the endomorphisms of M/S.