Solution (source code)

= Solution

Use the defining criterion that a <flat module> $E$ makes $u\otimes1_E$ <injective> for every <injective> <module homomorphism> $u$. By <right exactness of the tensor product>, preserving injections is equivalent to preserving every <short exact sequence>.

First assume $E$ is <flat> over $A$, and fix a <maximal ideal> $\mathfrak m$. Let $u:U\hookrightarrow V$ be an <injection> of $A_{\mathfrak m}$-modules. Regard it as an <injection> of $A$-modules. There are natural <module isomorphisms>
$$
U\otimes_{A_{\mathfrak m}}E_{\mathfrak m}\cong U\otimes_AE,\qquad V\otimes_{A_{\mathfrak m}}E_{\mathfrak m}\cong V\otimes_AE.
$$
For example, $u_0\otimes(e/s)$ maps to $s^{-1}u_0\otimes e$, with inverse $u_0\otimes e\mapsto u_0\otimes(e/1)$. These are well-defined because every $s\notin\mathfrak m$ already acts invertibly on $U$. Under these <isomorphisms> the tensor map is $u\otimes_A1_E$, which is <injective> by flatness. Thus $E_{\mathfrak m}$ is <flat> over $A_{\mathfrak m}$.

For the converse, assume every $E_{\mathfrak m}$ is <flat> over $A_{\mathfrak m}$ and take any <injection> $u:U\hookrightarrow V$ of $A$-modules. By part (c), each $u_{\mathfrak m}$ is <injective>. Since <localization commutes with tensor products>, the <localization> of $u\otimes_A1_E$ identifies with
$$
u_{\mathfrak m}\otimes_{A_{\mathfrak m}}1_{E_{\mathfrak m}}:U_{\mathfrak m}\otimes_{A_{\mathfrak m}}E_{\mathfrak m}\longrightarrow V_{\mathfrak m}\otimes_{A_{\mathfrak m}}E_{\mathfrak m}.
$$
It is <injective> by the assumed local flatness. Apply part (c) again, now to $u\otimes_A1_E$, to conclude that it is <injective> globally. Since $u$ was arbitrary, $E$ is <flat>. Therefore
$$
\boxed{E\text{ is <flat> over }A\iff E_{\mathfrak m}\text{ is <flat> over }A_{\mathfrak m}\text{ for every maximal }\mathfrak m.}
$$
This proves <flatness is local> without any finite-generation hypothesis.