Localization commutes with quotient Suppose $R$ is a commutative ring and $D$ a multiplicatively closed subset. I'd like to show via universal properties that if $\mathfrak{a} \triangleleft R$ is an ideal, then $D^{-1}R/D^{-1}\mathfrak{a} \cong \bar{D}^{-1}(R/\mathfrak{a})$, where $\bar{D}$ is the image of $D$ in $R/\mathfrak{a}$. This is pretty close to using exactness on the sequence $0 \to \mathfrak{a} \to R \to R/\mathfrak{a} \to 0$, except now we're localizing $R/\mathfrak{a}$ with respect to $\bar{D}$, not just tensoring it with $D^{-1}R$. Essentially I'm trying to show that localization commutes with passing to the quotient by $\mathfrak{a}$.
I could probably brute force this proof, but I'd like to see it in a way that is easy to understand and to remember. I get the feeling it's an easy property in disguise.
 A: Let us define a ring-homomorphism $u:R\to T$ by the universal property that a ring-homomorphism $f:R\to S$ factors (uniquely) through $u$ iff $f$ maps every element of $D$ to a unit and every element of $\mathfrak{a}$ to $0$.  From the universal property of $D^{-1}R$, we see that any $f$ which factors through $u$ must factor through the localization map $i:R\to D^{-1}R$ via a unique map $g:D^{-1}R\to R$.  Moreover, a map $f$ that factors through $i$ will factor through $u$ iff additionally $f(a)=g(i(a))=0$ for all $a\in \mathfrak{a}$.  This happens iff $g$ maps all of $i(\mathfrak{a})$ to $0$.  Equivalently, $g$ must factor through the quotient of $D^{-1}R$ by the ideal in $D^{-1}R$ generated by $i(\mathfrak{a})$, which is exactly $D^{-1}\mathfrak{a}$.  This shows that maps factoring through $u$ are naturally in bijection with maps factoring through the composition $R\to D^{-1}R\to D^{-1}R/D^{-1}\mathfrak{a}$, so $T\cong D^{-1}R/D^{-1}\mathfrak{a}$.
On the other hand, we can do the same thing but in the reverse order to get that $T\cong \bar{D}^{-1}R/\mathfrak{a}$ as well.  By the universal property of $R/\mathfrak{a}$, we see that if $f$ factors through $u$ then it factors through the quotient map $p:R\to R/\mathfrak{a}$ via a unique map $h:R/\mathfrak{a}\to S$.  And a map $f$ which factors through $h$ will factor through $u$ iff additionally $f(d)=h(p(d))$ is a unit for all $d\in D$.  This is equivalent to saying that $h$ factors through the localization of $R/\mathfrak{a}$ with respect to $p(D)=\bar{D}$.  So $f$ factors though $u$ iff it factors through the composition $R\to R/\mathfrak{a}\to \bar{D}^{-1}R/\mathfrak{a}$.
A: I brute-forced this just for the fun of it, in a slightly different flavour than the above answer. First, the composition $R\to R/\mathfrak{a} \to \overline{D}^{-1}(R/\mathfrak{a})$ sends $D$ to invertible elements and so we get a map $\varphi: D^{-1}R\to \overline{D}^{-1}(R/\mathfrak{a})$ via $\frac{r}{d}\mapsto \frac{[r]}{[d]}$, where the brackets denote mod $\mathfrak{a}$. This map sends $D^{-1}\mathfrak{a}$ to $0$ and so we get a map 
$$ \psi: \frac{D^{-1}R}{D^{-1}\mathfrak{a}} \rightarrow \overline{D}^{-1}\left(\frac{R}{\mathfrak{a}}\right) \hspace{.5cm} \text{via} \hspace{.5cm} \left[\frac{r}{d}\right] \mapsto \frac{[r]}{[d]}.$$
Similarly, the composition $R\to D^{-1}R\to \frac{D^{-1}R}{D^{-1}\mathfrak{a}}$ sends $\mathfrak{a}$ to $0$, and so we get a map $\theta: R/\mathfrak{a} \to \frac{D^{-1}R}{D^{-1}\mathfrak{a}}$ via $[r]\mapsto [r/1]$. This map sends $\overline{D}$ to units because $[d/1]\cdot [1/d]=[1/1]$, and so we get a map 
$$ \eta: \overline{D}^{-1}\left(\frac{R}{\mathfrak{a}}\right) \rightarrow \frac{D^{-1}R}{D^{-1}\mathfrak{a}} \hspace{.5cm} \text{via} \hspace{.5cm}  \frac{[r]}{[d]} \mapsto \left[\frac{r}{d}\right].$$
Thus $\psi$ and $\eta$ are inverses, QED.
