Let $K$ be a number field with ring of integers $\mathcal O$. Moreover let $M$ be a finitely generated projective $\mathcal O$-module of rank $1$ (equivalently a finitely generated and locally free $\mathcal O$-module of local rank $1$). Let's denote with $M_{\mathfrak p}$ the usual localization of $M$ at the prime ideal $\mathfrak p\subset \mathcal O$.
I'd like to find a proof for the following claim:
Let $m\in M\otimes_{\mathcal O} K$, if for any nonzero prime $\mathfrak p$ of $\mathcal O$, the projection of $m$ in $M_{\mathfrak p}\otimes_{\mathcal O_\mathfrak p} K$ lies in $M_{\mathfrak p}=M_{\mathfrak p}\otimes_{\mathcal O_{\mathfrak p}}\mathcal O_{\mathfrak p}$ (as $\mathcal O_{\mathfrak p}$ module), then $m\in M$.
The converse is obvious since locally we can write $M_{\mathfrak p}=\alpha_{\mathfrak p}\mathcal O_{\mathfrak p}$ for $\alpha_{\mathfrak p}\in M_{\mathfrak p}.$
I know that the claim in question should be true, because is like sayng: "all meromorphic functions with non negative order at each point are holomorphic", by the way I'm not able to write a formal proof.
Assume the opposite. Then $(M:m) \subset \mathcal O$ is a proper ideal, let $\mathfrak p$ be a maximal ideal containing it.
By the assumption $m \in {M_\mathfrak p}$, we have $sm \in M$ for some $s \notin \mathfrak p$. But by the definition of the colon ideal, this yields $s \in (M:m) \subset \mathfrak p$. Contradiction!