Lemma 10.31.9. Let $R$ be a ring and $\mathfrak p \subset R$ be a prime. There exists an $f \in R$, $f \not\in \mathfrak p$ such that $R_ f \to R_\mathfrak p$ is injective in each of the following cases

1. $R$ is a domain,

2. $R$ is Noetherian, or

3. $R$ is reduced and has finitely many minimal primes.

Proof. If $R$ is a domain, then $R \subset R_\mathfrak p$, hence $f = 1$ works. If $R$ is Noetherian, then the kernel $I$ of $R \to R_\mathfrak p$ is a finitely generated ideal and we can find $f \in R$, $f \not\in \mathfrak p$ such that $IR_ f = 0$. For this $f$ the map $R_ f \to R_\mathfrak p$ is injective and $f$ works. If $R$ is reduced with finitely many minimal primes $\mathfrak p_1, \ldots , \mathfrak p_ n$, then we can choose $f \in \bigcap _{\mathfrak p_ i \not\subset \mathfrak p} \mathfrak p_ i$, $f \not\in \mathfrak p$. Indeed, if $\mathfrak {p}_ i\not\subset \mathfrak {p}$ then there exist $f_ i \in \mathfrak {p}_ i$, $f_ i \not\in \mathfrak {p}$ and $f = \prod f_ i$ works. For this $f$ we have $R_ f \subset R_\mathfrak p$ because the minimal primes of $R_ f$ correspond to minimal primes of $R_\mathfrak p$ and we can apply Lemma 10.25.2 (some details omitted). $\square$

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).