Consider the ring $R=\{\frac{a}{b} : p_1\nmid b,p_2\nmid b\}\subset \mathbb{Q}$ for distinct primes $p_1,p_2$.
Question is to prove that $I=\{\frac{a}{b}\in R : p_1\mid a \}$ is a maximal ideal of $R$.
Let $\frac{a}{b}\in R\setminus I$ i.e., $p_1\nmid a$. Then, we have to prove that $\frac{a}{b}$ with $I$ generates the whole ring.
Suppose $p_2\nmid a$ then $\frac{b}{a}$ is an element of $R$ and so $\frac{a}{b}$ is a unit and we have nothing to prove.
So, we can suppose that $p_2\mid a$. We then want $\frac{m}{n}\in R$ such that $$1-\frac{ma}{nb}\in I$$
i.e., Given $a,b$ such that $p_1,p_2\nmid b$ and $p_1\nmid a, p_2\mid a$, we want $m,n\in \mathbb{Z}$ such that $p_1\mid ma\pm nb$
I got stuck at this point. Could not think beyond this.
We construct a homomorphism from $R$ onto a field, with kernel $I$, then the result follows from the isomorphism theorem. Let $\varphi: R \rightarrow \mathbb{F}_{p_1}$ be given by $\frac{a}{b} \mapsto ab^{-1}$, where we write $\frac{a}{b}$ such that $\gcd(a,b) = 1$(note that $\varphi$ is well defined). This surely is a homomorphism, $1 \mapsto 1$, it respects the multiplicative structure and the additive structure. $ab^{-1} = 0$ in $\mathbb{F}_{p_1}$ if and only if $a = 0 $ in $\mathbb{F}_{p_1}$ because $\mathbb{F}_{p_1}$ is a field. So the kernel is exactly $I$. Hope this helps. It seems odd to me because I did not use $p_2$, but I hope that doesn't matter.