An integral domain $A$ is exactly the intersection of the localisations of $A$ at each maximal ideal

Or equivalently, suppose $z$ is not in $A$. Also consider the ideal $I=A:z=\{x\in A: xz \in A\}$. Then $I$ is a proper ideal since $1\not\in I$. Then there exists a maximal ideal $\mathfrak{m}$ containing $I$. The element $z$ must be not in $A_{\mathfrak{m}}$, otherwise, there exists some $s\not\in \mathfrak{m}$ such that $sz \in A$, hence $s\in I$ which contradicts the choice of the maximal ideal $\mathfrak{m}$.


Since $A$ is a domain, the localization map $A \to A_{\mathfrak m}$ is injective for every maximal ideal $\mathfrak m$, so $A \subseteq \cap_{\mathfrak m \in \text{mSpec} A} A_{\mathfrak m}$. The other inclusion is more interesting: suppose $z \in K$, with $z \in A_{\mathfrak m}$ for every maximal ideal $\mathfrak m$. Consider the $A$-ideal $I := A :_A Az = \{x \in A \mid xz \in A\}$. We want $1 \in I$, i.e. $I = A$. But to show this we can localize: $I_{\mathfrak m} = (A :_A Az)_{\mathfrak m} = A_{\mathfrak m} :_{A_{\mathfrak m}} A_{\mathfrak m}z = A_{\mathfrak m}$ (since $Az$ is a finitely generated $A$-module) for every maximal ideal ${\mathfrak m}$, so indeed $I = A$.