Rank of a module without a basis I know that the rank of a module is the number of elements in a basis. What is the rank if a module doesn't have a basis? Here's my thought process:
My initial guess is that the answer is $0$. However, I feel like zero rank means that the basis does not have any element (ie. $\emptyset$), which is not the same as non-existence of a basis. I don't think $0$ is the answer here.
 A: The rank of a free module is the number (or rather cardinality) of elements in its basis. But the notion of rank extends to arbitrary modules, though behaves less intuitively.
The main problem why your intuition fails to work, i.e. why a module of rank $0$ is not necessarily the trivial module, is the phenomenon of torsion. This is non-existent for vector spaces but important for general modules. For example, both $\mathbb Z$ and $\mathbb Z/2\mathbb Z$ are both non-trivial $\mathbb Z$-modules but one is of rank $1$ and one is of rank $0$. The rank is somewhat the "number of free copies of the base ring" (be warned that this fails to work over general rings too). Note that torsion always is problematic in this regard as a torsion element is linearly dependent with itself!
Let's consider an integral domain $R$ for simplicity. Then the rank of an $R$-module $M$ can be defined as the $K$-vector space dimension of $M\otimes _R K$ for $K=\operatorname{Quot}(R)$ the quotient field of $R$. This definition coincides with defining the rank as the cardinality of a maximal linearly indepedent subset (such a subset always sits inside a free module if $M$ is finitely generated though is not necessarily free itself!) and for a field recovers the definition of the usual dimension. Tensoring (or localising if you prefer) makes sure to kill off any torsion. This is another perspective on why having rank $0$ is perfectly fine for a non-torsionfree module.
So contrary to vector spaces the rank does not determine a module, whereas the dimension of a vector space does. Hence there may be non-isomorphic modules of the same rank (e.g. all torsion modules have rank $0$ and can be non-trivial still).
