Let $R$ be a ring, $f \in R$, and $X$ a variable. Show $R_{f} \simeq R[X]/\langle 1-fX \rangle$.
I am a beginner in algebra and I am reading a textbook in commutative algebra. What I do not understand is that: How does the proof apply universal mapping properties in the second part of the proof? I do not see the quotient ring appears in the second part. Why we need $\theta$.
Basically, explanation on the second part in details to a beginner would be appreciated.

In general, universal properties provide a powerful way of proving algebraic objects are isomorphic because they state a defining property that the object must satisfy. That is, if any other object satisfies this property then it is isomorphic to the original object. In the case of localisation, the universal property says:
Given any ring $R$ and an element $f\in R$ then the localisation $R_f$ is a ring together with a map $\phi: R\rightarrow R_f$ satisfying following: given any ring map $\psi: R\rightarrow R''$ such that $f$ maps to a unit in $R''$ then there is a unique ring map $\rho: R_f\rightarrow R''$ such that $\psi = \rho\circ\phi$.
The key fact to realise (essential exercise) is that this characterises $R_f$ up to isomorphism, that is, given any other ring, $S$, that satisfies this property then $S$ is isomorphic to $R_f$.
Once you have this, in order to prove anything is isomorphic to $R_f$ all you need to do is show that it satisfies the universal property. This is what your quoted text does:
It starts with an arbitrary map $\psi:R\rightarrow R''$ such that $\psi(f)$ is a unit, ie $\psi(f)^{-1}$ exists. Then in order to construct a map $R[x]/(1-fx)\rightarrow R''$, first construct a map $\theta: R[x]\rightarrow R''$ that factors through the quotient (NB: this uses the universal property of quotient rings!) $\rho: R[x]/(1-fx)\rightarrow R''$.