Sum of localization maps In Eisenbud's Commutative algebra with a view..., he shows that if an $A$-module $M$ has a finite length, then the sum of localization maps at maximal ideals  is an isomorphism:
$$\phi:M\overset{\sim}{\rightarrow}\oplus_{\mathfrak{m}}M_{\mathfrak{m}}.$$
But isn't this true for any module (i.e., not necessarily finite length)? My argument is that $\phi$ is an isomorphism because $\phi_{\mathfrak{m}}$ is an isomorphism for every maximal ideal $\mathfrak{m}$ since 
$$\mbox{Supp}M_{\mathfrak{m}}=\mbox{Supp}M\cap\mbox{Spec}A_{\mathfrak{m}}.$$
Am I missing something here? I think only difference that $\ell(M)<\infty$ makes is maybe the sum is finite...
 A: Let us discuss this in a number of steps:
Exercise 1: Let $A$ be a commutative ring and let $M$ be an $A$-module. Let $\text{MaxSpec}(A)$ be the set of all maximal ideals of $A$. Prove that the natural $A$-module homomorphism $\phi:M\to \bigoplus_{m\in\text{MaxSpec}(A)} M_m$ is injective. (Hint: if $x\in M$, choose a maximal ideal $m$ of $A$ such that $\text{Ann}(x)=\{a\in A:ax=0\}\subseteq m$. Consider the image of $x$ in $M_m$.)
Exercise 2: Let us consider the $\mathbb{Z}$-module $\mathbb{Z}$ and let $\phi:\mathbb{Z}\to \bigoplus_{m\in\text{MaxSpec}(\mathbb{Z})} \mathbb{Z}_m$ be the natural $\mathbb{Z}$-module homomorphism. Prove that $\phi$ is not surjective. (Hint: let us order the positive prime numbers in the manner $p_1,p_2,\dots$. If $n\in \mathbb{Z}$, let us remark that the image of $n$ in $\mathbb{Z}_{p_i}$ is $\frac{n}{1}$. Prove that the element $(1,0,0,\dots)\in \bigoplus_{i=1}^{\infty} \mathbb{Z}_{p_i}$ has no preimage in $\mathbb{Z}$ under $\phi$. If you are stuck, think about the kernel of the localization homomorphism $\mathbb{Z}\to \mathbb{Z}_{p_i}$ for $i\in\mathbb{N}$.)
Problem 1: Let $A$ be an integral domain. Prove that the natural $A$-module homomorphism $\phi:A\to \bigoplus_{m\in\text{MaxSpec}(A)} A_m$ is not surjective unless $A$ is a local domain. Can you generalize to other commutative rings?
Problem 2: Let $A$ be an integral domain. Prove that $A=\bigcap_{m\in\text{MaxSpec}(A)} A_m$.
I hope this helps! 
A: I realized an error in my argument. The equation should be more properly read
$$\mbox{Supp}_{A_\mathfrak{m}}M_{\mathfrak{m}}=\mbox{Supp}_AM\cap\mbox{Spec}A_{\mathfrak{m}}.$$
$\phi$ is an $A$-module homomorphism, and $M_{\mathfrak{m}}$ here should be viewed as an $A$-module, not an $A_{\mathfrak{m}}$-module. So $\mbox{Supp}_AM_{\mathfrak{m}}$ may be actaully larger than $\mbox{Supp}_{A_{\mathfrak{m}}}M_{\mathfrak{m}}$. So, even if $\mathfrak{m}\neq\mathfrak{n}$ are two distinct maximal ideals, $(M_{\mathfrak{m}})_{\mathfrak{n}}$ may not be zero. I don't have a definite example, but at least this makes my previous argument invalid.
