TITLE: $A = \bigcap_{\mathfrak{p} \in \text{Spec(A)}} A_{\mathfrak{p}} = \bigcap_{\mathfrak{m} \in \text{MaxSpec(A)}} A_{\mathfrak{m}}$
QUESTION [6 upvotes]: I'm doing this exercise.

Let $A$ be an integral domain, then prove that $$A = \bigcap_{\mathfrak{p} \in \text{Spec(A)}} A_{\mathfrak{p}} = \bigcap_{\mathfrak{m} \in \text{MaxSpec(A)}} A_{\mathfrak{m}}$$ where the intersection is taken in the quotient field of $A$ and $A_{\mathfrak{p}}$ is the localization of $A$ at the prime ideal $\mathfrak{p}$, similarly for $A_{\mathfrak{m}}$ .

What I have done: we have $$A \subseteq \bigcap_{\mathfrak{p} \in \text{Spec(A)}} A_{\mathfrak{p}} \subseteq \bigcap_{\mathfrak{m} \in \text{MaxSpec(A)}} A_{\mathfrak{m}}$$ so it suffices to prove that $$\bigcap_{\mathfrak{m} \in \text{MaxSpec(A)}} A_{\mathfrak{m}} \subseteq A$$
 Suppose $\frac{a}{b} \in \bigcap_{\mathfrak{m} \in \text{MaxSpec(A)}} A_{\mathfrak{m}}$ . I want to show that $b$ is invertible.
If $b$ is not invertible then there exists $ \mathfrak{m} \in \text{MaxSpec(A)} $ such that $b \in \mathfrak{m}$. By hypothesis $$\frac{a}{b} = \frac{r}{s}$$ with $s \not\in \mathfrak{m} $. 
$A$ is a domain so $sa = rb \in \mathfrak{m} $ and thus $ a \in \mathfrak{m} $. Then I don't know how to proceed , any hint ?

REPLY [2 votes]: Key Idea the set of maximal ideals contain enough witnesses to show that every proper fraction has nontrivial denominator (ideal), $ $ i.e. if a fraction $\,f\not\in A\,$ then its denominator ideal $\, {\cal D}_f = \{ d\in A\ :\  d\:\!f\in A\} \ne (1),\:$ so $\, \cal D_f\,$ is contained in some maximal ideal $\,M,\,$ hence $\,f\not\in A_M.\:$ Therefore we conclude that   $ \,f\not\in \bigcap A_{M}$ over all ${M \in \text{MaxSpec(A)}}.$