I am reading Serre's book on Lie Algebras and Lie Groups. On Lemma 4.3, he states that
If $E$ is a finitely generated $\mathbb{Z}$-module and $\dim(E \otimes_{\mathbb{Z}} \mathbb{F}_p)$ over $\mathbb{F} = \mathbb{Z} / p\mathbb{Z}$ is independent of $p$, for all primes $p$, then $E$ is a $\mathbb{Z}$-free module with rank equal to the dimension of $E \otimes_{\mathbb{Z}} \mathbb{F}_p$ over $\mathbb{F}_p$.
Serra says that "this lemma is an easy consequence of the structure theorem of abelian groups". I have no idea on how to pass from $\mathbb{F}_p$ to $\mathbb{Z}$.
How can this be proved? Also, is there a nice "categorical" argument behind?