Let $K$ be a number field and let $M$ be a free $\mathbb{Z}$-submodule of $K$ of rank $n=[K:\mathbb{Q}]$. I want to prove that $$ \mathfrak{o}=\{x\in K : xM\subset M\} $$ defines an order of $K$. That is, it is a subring of $K$ and a free $\mathbb{Z}$-module of rank $n$.
It is easy to see that $\mathfrak{o}$ is a subring of $K$. But how do I see that it is free of rank $n$? I think it would be useful to know that it is contained in the maximal order $\mathcal{O}_K$ because then I know $\mathfrak{o}$ has to be free of rank $\leq n$. Then it would remain to prove that it contains a $\mathbb{Q}$-basis of $K$ for example.