Finitely generated $\mathbb{Z}$-modules & localization Prove that every $\mathbb{Z}$-module finitely generated is free if, and only if, it is locally free.
Any hints?
I have checked this question but I'm not clear on how to proceed with the implication $(\Leftarrow)$ and the whole "basis" thing. Is this one of those instances where we have to consider localizations as extensions of scalars?
 A: There are two useful facts related to your question.
For $R$-module $M$,

*

*$M$ is finite locally free $\Leftrightarrow$ $M$ is finite projective

*if $R$ is PID, $M$ is projective $\Leftrightarrow$ $M$ is free

The first fact is explained in https://stacks.math.columbia.edu/tag/00NV, the second one is in here. Applying these to the case $R=\mathbb{Z}$, we are done.
A: You can prove this very simply using the classification of finitely generated $\mathbb{Z}$-modules, which says they are always a direct sum of cyclic modules.  In particular, to prove a finitely generated module is free, it suffices to show it is torsion-free.  But now suppose a module $A$ has torsion, so for some prime $p$, it has an element of order $p$.  This element generates a submodule isomorphic to $\mathbb{Z}/(p)$.  Now $\mathbb{Z}/(p)$ is already a $(p)$-local module, so when we localize $A$ at $(p)$, this submodule is unchanged.  In other words, $A_{(p)}$ has a submodule isomorphic to $\mathbb{Z}/(p)$, and thus it has torsion and so is not free.  So, $A$ is locally free.
A: Here's a proof avoiding the structure theorem and using a minimum of general commutative algebra. Let $A$ be a finitely generated abelian group. We will need the small fact that $\mathbb{Z}$ is Noetherian, so subgroups of $A$ are finitely generated, and in particular the torsion subgroup $A_{tors}$ is finitely generated and hence finite. Localizing $A_{tors}$ at each prime $p$ gives the $p$-torsion subgroup of $A_{tors}$, which by the exactness of localization embeds into the localization $A_{(p)}$. But a free $\mathbb{Z}_{(p)}$-module has no $p$-torsion, so $A_{tors}$ is trivial. So if $A$ is locally free then in particular it is torsion-free.
Now it suffices to show that a torsion-free finitely generated abelian group $A$ is free. This can be done explicitly, without the structure theorem, by showing that a minimal generating set is a basis; see Jyrki Lahtonen's answer here.
This argument shows that every finitely generated abelian group is an extension
$$0 \to A_{tors} \to A \to A/A_{tors} \to 0$$
where $A_{tors}$ is finite and $A/A_{tors}$ is (torsion-free, hence) finite free. Since $A/A_{tors}$ is projective this short exact sequence splits, so
$$A \cong A_{tors} \oplus \mathbb{Z}^n$$
which reduces the structure theorem to the case of finite abelian groups; this was done by Kronecker, before the structure theorem for finitely generated abelian groups was proven. The Chinese remainder theorem further reduces the structure theorem to the case of finite abelian $p$-groups, which I think can be done pretty bare-handedly.
