Let $R$ be a commutative ring with $1$ and let $D=\{\,f^n\,|\,n\geq0\,\}$ be the multiplicative set where $f\in R$ is not nilpotent. And the question is the topic. The following is my idea:
Let $\varphi:R[x]\to D^{-1}R$ defined by $r\mapsto r$ and $x\mapsto1/f$. Then clearly $\varphi$ is surjective so that $$ R[x]/\ker\pi\cong D^{-1}R $$ by the First Isomorphism Theorem. Via the isomorphism above, by the universal property of localization, the following diagram $$ \require{AMScd}\begin{CD} R @>>> R[x]/\ker\varphi\\ @. {_{\rlap{}}\style{display: inline-block; transform: rotate(30deg)}{{\xrightarrow[\rule{3.52em}{0em}]{}}}} @V\psi VV\\ @. R[x]/(xf-1) \end{CD} $$ commutes where the arrows are compositions of natural injections and natural projections: $$ \begin{cases} R\hookrightarrow R[x]\twoheadrightarrow R[x]/\ker\varphi \\R\hookrightarrow R[x]\twoheadrightarrow R[x]/(xf-1). \end{cases} $$ By the universal property of quotient rings, the following diagram $$ \require{AMScd}\begin{CD} R[x] @>>> R[x]/(xf-1)\\ @. {_{\rlap{}}\style{display: inline-block; transform: rotate(30deg)}{{\xrightarrow[\rule{3.52em}{0em}]{}}}} @VV\phi V\\ @. R[x]/\ker\varphi \end{CD} $$ commutes where the arrows are compositions of natural projections: $$ \begin{cases} R[x]\twoheadrightarrow R[x]/(xf-1). \\R[x]\twoheadrightarrow R[x]/\ker\varphi. \end{cases} $$ Now we get two unique homomorphisms $\psi$ and $\phi$ determined by the arrows from $R$ and $R[x]$ to $R[x]/(xf-1)$ and $R[x]/\ker\varphi$.
[1] Whether the isomorphism $(R[x]/(xf-1))/(\ker\varphi/(xf-1))\cong R[x]/\ker\varphi$ is useful or not to solve this problem.
[2] It remains to show that $\ker\pi\subseteq(xf-1)$, which is "not difficult to see that" stated by the authors, but I do not know how to move on. Is there a quick way to show this just by the universal properties of localizations and quotient rings? Since I have not learnt the universal property of polynomial rings as mentioned in other answers.
Update: I have known the usage of the universal property of universal property of localizations, by @linkja and @Bill Dubuque 's help, as follows:
It is clear in the ring $R[x]/\langle xf-1\rangle$ we have that $\iota(1)=1+\langle xf-1\rangle$ and $\iota(f^n)^{-1}=x^n+\langle xf-1\rangle$ where $D=\{\,f^n\,|\,n\geq0\,\}$, so we can use the universal property of localizations to obtain the commutative diagram: $$ \require{AMScd}\begin{CD} R @>\sigma>> D^{-1}R\cong R[x]/\ker\varphi\\ @. {_{\rlap{}}\style{display: inline-block; transform: rotate(30deg)}{{\xrightarrow[\rule{3.52em}{0em}]{\iota}}}} @V\psi VV\\ @. R[x]/\langle xf-1\rangle \end{CD} $$ where $\iota=\psi\circ\sigma$. Since $\psi$ is surjective, it suffices to show that $\psi$ is also injective.
In fact, in this commutative diagram, $\psi$ is injective if and only if $\iota$ is injective.
Since $\iota$ is injective proved in this link, $\ker(\psi\circ\sigma)=\ker\iota=0$, i.e., $\forall\,r\in R/\{0\}$, $\psi(r)=\psi(\sigma(r))\ne0$. Since $0\not\in D$, $\forall\,d\in D\subseteq D^{-1}R$, $\psi(d)=\psi\circ\sigma(d)=\iota(d)\in(R[x]/\langle xf-1\rangle)^{\times}$, i.e., $\psi(d)$ is never a zero divisor.
Thus $\forall\,d^{-1}r\in D^{-1}R$, $$ \begin{aligned} \psi(d^{-1}r)=\psi(d)^{-1}\psi(r)&=0 \\(\text{since }\psi(d)\text{ is never a zero divisor})\ \ \text{iff}\ \ \psi(r)&=0 \\\text{iff}\ \ \iota(r)=\psi\circ\sigma(r)=\psi(r)&=0 \\(\text{since }\iota\text{ is injective})\ \ \text{iff}\ \ r&=0 \\\text{iff}\ \ d^{-1}r&=0, \end{aligned} $$ hence $\psi$ is injective. And since $\psi$ is also a surjective ring homomorphism, $\psi$ is an isomorphism, so finally we get $$ R_f=D^{-1}R\cong R[x]/\ker\varphi=R[x]/\langle xf-1\rangle, $$ as desired.
Update: The above answer is not completed: it have not considered the case that $f$ is a zero divisor so $\iota$ is not necessarily injective. I have given a complete proof here: use universal property of localization to show that $R_f\cong R[x]/\langle xf-1\rangle$ where $f$ may be a zero-divisor but not nilpotent.