let $R$ be a domain with field of fractions $F=Frac(R)$ and $A$ the integral closure of $R$. we have a canonical inclusion map $\varphi:R \to A$. if we assume that $\varphi$ is a flat map why does this already imply that $R=A$? in this question the OP used
Fact: Let $A$ be an integral domain and $K$ be its field of fractions. Also let $B$ be a finitely generated $A$-submodule of $K$. Then $B$ is flat iff $B$ is locally free of rank $1$.
why this Fact holds? I don't understand why the equivalence that $B$ is flat iff $B$ is locally free of rank $1$ holds. I shall be delighted if anybody could give a sketch of the proof. I know that locally every flat map is free. what I know about the rank? this means that for every prime $\mathfrak{p}$ of $R$ the $R_{\mathfrak{p}}$-module $A_{\mathfrak{p}}$ is free of some rank $r_p$. since $R$ and $A$ have same fraction field the rank is $1$ at generic point. the question is why is then the rank $r_p$ equals $1$ at every prime $\mathfrak{p}$ of $R$? guess that there exist a flatness argument but haven't found such one.