For a commutative ring $R$ with $1\neq 0$ and a nonzerodivisor $r \in R$, let $S$ be the set $S=\{r^n\mid n\in \mathbb{Z}, n\geq 0\}$ and denote $S^{-1}R=R\left[\frac{1}{r}\right]$. Prove that there is a ring isomorphism $$R\left[\frac{1}{r}\right]\cong \frac{R[x]}{(rx -1)}.$$
I'm thinking maybe I can find a homomorphism from $R[x]$ to $R\left[\frac{1}{r}\right]$ that has kernel $(rx-1)$, and then use the first isomorphism theorem. Is this the right approach?