Let $D$ a PID, $F$ a free module rank $n$, $N$ a submodule of $F$.

I want to prove (or find a counterexample) of: $\text{rank}(F/N)=0 \Longleftrightarrow\text{rank}(F)=\text{rank}(N)$

- $\text{rank}(F/N)=0\Rightarrow F/N=0 \Rightarrow F=N \Rightarrow \text{rank}(F)=\text{rank}(N)$
- I know it to the left is false for a ring (I take $d$ a non-zero divisor and I prove that is $(d)$ is not free. I think taking $\mathbb{Z}$ and $2\mathbb{Z}$ can work, because $\{1\}$ is a basis of $\mathbb{Z}$ and $\{2\}$ appears to be a basis of $2\mathbb{Z}$, so their rank is 1 but I can't prove $\text{rank}(\mathbb{Z}/2\mathbb{Z})$ is non-zero (basically because I think it is not free).

Does this counterexample work?