Prove that an element in the quotient field is actually in the ring itself Let $R$ be a noetherian integral domain and $K$ the quotient field of $R.$ Suppose $f \in K.$ Suppose for each maximal ideal $M$ of $R,$ we can find $h,k\in R$ so that $f = h/k$ and $k \not\in M$. Show $f \in R.$
Note: $R$ is not assumed a UFD!
My attempt:
I tried to prove that the summation of ideals generated by all the k that are not in some maximal ideals is the whole ring. But I dont know how to use that to move on. Also, I do not understand how to show an element is in the ring. I tried to prove that k has to divide h, but since R is not a UFD, I am not sure to achieve that.
 A: Define $I=\{a\in R: af\in R\}\subseteq R$. This is clearly an ideal of $R$. If we can show that $I=R$ then it means $1\in I$ and so $f\in R$, as we want. So suppose $I\ne R$. Then $I$ is contained in some maximal ideal $M$. By assumption, there are $h,k\in R$ such that $f=\frac{h}{k}$ and $k\notin M$. But then note that:
$kf=k\frac{h}{k}=h\in R$
And so $k\in I\subseteq M$, a contradiction.
Note that you don't even need $R$ to be Noetherian.
A: All you need is for $R$ to be a domain. We'll prove
$\newcommand{\m}{\mathfrak{m}}$

Proposition. $R=\bigcap_{\m}R_\m$.

In the above, the intersection runs over all maximal ideals of $R$, and we identify $R_\m$ with the subring $\{\frac rs\mid r\in R, s\in R\setminus\m\}$ of $K$. One inclusion is obvious: the canonical maps $R\hookrightarrow R_\m\hookrightarrow K$ show that $R$ is a subset of the intersection $\bigcap_{\m}R_\m$.
The reverse inclusion is equivalent to
$$
K \setminus R
\subset 
K\setminus \bigcap_{\m}R_\m
\quad\text{i.e.}\quad
K \setminus R
\subset
\bigcup_{\m}~(K\setminus R_\m)
$$
So consider $x\in K\setminus R$ and put $J=\{r\in R\mid rx\in R\}$. Then $J$ is a proper ideal of $R$: it's obviously an ideal of $R$ and not all of $R$ since $1\notin J$. By Zorn's lemma, $J$ is contained in some maximal ideal $\m_0$. The claim is now that $x\in K\setminus R_{\m_0}$. Otherwise we could write $x=\frac rs$ with $r\in R$, $s\in R\setminus\m_0$, but then $sx=r\in R$ and $s\in J\subset\m_0$, which is a contradiction. Therefore $x\in K\setminus R_{\m_0}$ and we are done.
