“Only if” is clear. Conversely, suppose \(\overline{f}\)  is flat. If \(J\)  is nilpotent (e.g. if \(A\)  is Artinian), then flatness of \(f\)  follows from Proposition 0.8.3.7 in [1]}.
In the general case, write \(A\)  as a filtered colimit \(A \simeq \mathop {\mathrm {colim}}_{i \in I} A_i\)  where \(A_i \subset A\)  is a filtered system of \(\mathbf {Z}\) -algebras of finite type. Set \(J_i = J \cap A_i\) , so \(J_i \subset A_i\)  is a nilpotent ideal. By standard approximation arguments, there is an index \(i_0 \in I\)  such that \(f\)  is the base change along \(A_{i_0} \rightarrow A\)  of a map \(f_{i_0} : R_{i_0} \rightarrow S_{i_0}\)  of finitely presented \(A_{i_0}\) -algebras. For all \(i \ge i_0\) , write \(f_i : R_i \rightarrow S_i\)  for the evident base change of \(f_{i_0}\) . By two applications of [2]}, \(R_i\)  and \(S_i\)  are flat \(A_i\) -algebras for all sufficiently large \(i\) .
Next, note that \(\overline{f}\)  is the colimit of the diagrams \(\overline{f_i}: R_i / J_i R_i \rightarrow S_i / J_i S_i\) . Since \(\overline{f}\)  is flat by assumption, \(\overline{f_i}\)  is flat for all sufficiently large \(i\)  by another application of [2]}. But \(J_i\)  is nilpotent, so flatness of \(\overline{f_i}\)  implies flatness of \(f_i\)  by the special case of the lemma treated in the first paragraph of the proof. Therefore \(f_i\)  is flat for all sufficiently large \(i\) , so \(f\)  is flat.
