Let $A$ be a commutative ring with unity and let $M$ be an $A$-module. Say $f\in A$. It is clear that every $A\rightarrow M$ being $A$-module homomorphism induces map on the localizations $A_f\rightarrow M_f$. Is the reversed statement true? In other words: "Does every map between localizations have to be induced from some map between the original modules?"
I tried to use $M_f=M \otimes A_f$ equality and some universal properties but I wasn't successful. My guess is that it is false and a counterexample has to be searched in the cases where image of $A_f$ doesn't contain one of the element of the form $\frac{m}1$.
Hint: Consider $A=\mathbb{Z}$ and $f=2$, consider $h:\mathbb{Z}_2\rightarrow \mathbb{Z}_2$ defined by $h(1)=1/2$, it is not the localization of a morphism.