Here's the way I'd prove this fact.

Monomorphism $f: S \hookrightarrow M$ in the category of (say, left) $R$-modules is called *pure*, if one of those equivalent conditions are met:

a) $N \otimes f$ is injective for any right R-module $N$;

b) $f_*: \operatorname{Hom}(C, M) \to \operatorname{Hom}(C, M/S)$ is surjective for any finitely presented left module $C$;

c) $f^+: M^+ \to S^+$ is a split epimorphism, where $(-)^+$ is the duality functor from left to right modules $M \mapsto \operatorname{Hom}_{\Bbb Z}(M, \Bbb Q / \Bbb Z)$.

Now we need three observations, which follow pretty clearly from definitions above.

 1. Pure submodule of a flat module is flat. This is because quotient of a flat module by pure submodule is flat by a), and long exact sequence of Tors gives you this.

 2. $\bigoplus_I A_i$ is a pure submodule of $\prod_I A_i$ via natural inclusion by b) — every morphism from a finitely presented factors through the direct sum.

 3. Product of a pure monomorphisms is a pure monomorphism, by c).

There are a few good excercises on pure submodules in the book "Rings of quotients" by Bo Stenström. For a more detailed exposition of "pure homological algebra" one may consult monograph "Purity, spectra and localisation" my Mike Prest.