This is a basic question. Let $G$ be a finite group, $M$ a finitely generated $\mathbb Z[G]$-module so that the $\mathbb Z_p[G]$-module $M_p$ is free for all prime numbers $p$, i.e. is locally free.
Here $\mathbb Z_p[G]=\mathbb Z_p\otimes_\mathbb Z\mathbb Z[G]$ and $M_p=\mathbb Z_p\otimes_\mathbb ZM$ where $\mathbb Z_p$ is the $p$-adic completion of $\mathbb Z$.
1: How do we show that $\mathbb Q\otimes_\mathbb ZM$ is a free $\mathbb Q[G]$-module of well defined rank?
If the rank of $M$ is defined as the $\mathbb Q[G]$-rank of $\mathbb Q\otimes_\mathbb Z M$ then
2: How do we show that it's also the rank of $M_p$ over $\mathbb Z_p[G]$, for all $p$?
Thank you for your help.