The question I'm now going to ask for is related to that given here:
The rank of a module modulo its torsion elements
Let $R$ be an integral domain, $S=R \setminus \{0\}$ and $M$ be a $R$-module. Let moreover $S^{-1}M$ be its localization. It is clear that $S^{-1}M$ is a vector space over $S^{-1}R$. Moreover, it may be easily shown that the kernel of the map
$$ i: M \to S^{-1}M $$
agrees with the torsion of $M$, i.e. $Ker(i)=T(M)$. Thus, $M/T(M)$ is isomorphic to a submodule (i.e. subspace) of $S^{-1}M$. Now, in the question I cited, it has been proved that the rank of $M$ (namely the l.u.b. of the integers $n$ for which there exists a set of generators of $M$ with $n$ elements) agrees with the rank of $M/T(M)$. So the rank of $M$ is in general less than or equal to the dimension of the vector space $S^{-1}(M)$. Nevertheless, in this other question,
How do I calculate the dimension of the localization of a module?
the authors wrote $dim_\mathbf{Z}(M)=dim_\mathbf{Q}(M_\mathbf{Q})$, i.e. in the specific case of $Z$-modules equality holds. So, is this actually an equality or it could be happen that the rank of $M$ is strictly less than the dimension of $S^{-1}M$?
I provided an argument in the finite case. Assume that $S^{-1}M$ is a finite-dimensional vector space over $S^{-1}R$ and let $\{\frac{x_i}{s_i}\}_{i=1}^n$ a basis. We claim that $\{x_i\}_{i=1}^n$ are linearly independent in $M$. If they were not, then there exists a linear combination $a_1x_1+\dots+a_nx_n=0$ with some $a_i \neq 0$. Considering the element $a_1x_1+\dots+a_nx_n$ as an element of the localization, multiplying by $\frac{1}{s_1,\dots,s_n}$ we obtain a linear combination of $\{\frac{x_i}{s_i}\}_{i=1}^n$ which gives $0$ even if it has not non-zero coefficients. Is it right? What happens when dealing with infinite rank? May I restrict to finite sums using Hamel basis and, hence, to follow the previous argument?
It's an equality. If you take a linearly independent set of maximum cardinality, then (its image) it will be a $F$-basis for $M \otimes F$.
Edit with a hint: A maximal $R$-linearly independent subset of $M$ would generate a free submodule $N$ of $M$ so that $M/N$ is torsion (i.e. every element has nonzero annihilator). Say $N\simeq R^I$ for some index set $I$. Then $$D^{-1}M \simeq F^I$$ where $D:=R\setminus \{0\}$, and this is an isomorphism of $F$-modules.
To see this isomorphism, take the map $\varphi:M\rightarrow F^I$ given as follows. Let $\{x_i\}$ be the $R$-basis for $N$. Then for each $x\in M$, there is some $s\in D$ so that $sx\in N$, so we can write $sx=\sum r_ix_i$ for some $r_i\in R$. Now set $$\varphi(x):=\sum \frac{r_i}s x_i$$ and this is an element of $D^{-1}M$. Now it's your job to check that this induces a well-defined isomorphism of $F$-vector spaces $D^{-1}M\simeq F^I$.