I have a random variable $\xi : \Omega\to\mathbb{R}$ which distribution function has a density, so by definition I have that the probability measure of each $(-\infty,x]$ can be calculated by:
$$F_\xi(x)=P_\xi (-\infty,x]=\int_{-\infty}^x f_\xi(y)\mathrm{d}y \quad (1)$$
where the integral above is in the Lebesgue sense, with respect to the Lebesgue measure in $ \mathbb{R} $.
My book (Shiryayev, Probability, pg. 195) says that a wider formula holds, that is:
$$ P_\xi(B)=\int_B f_\xi \mathrm{d}x, \quad \forall B\in\mathcal{B}(\mathbb{R}) $$
How can I use (1) in order to obtain this last formula? In other words, how can I extend (1) to every Borel set?
If suffices to show that the equality holds for sets of the form $\{(a,b]:a<b\}$. Indeed, $$ \mathsf{P}_{\xi}((a,b])=\mathsf{P}_{\xi}((-\infty,b])-\mathsf{P}_{\xi}((-\infty,a])=\int_a^b f_{\xi}(y)\,dy. $$ Now, let $\mathcal{C}:=\{B\in\mathcal{B}(\mathbb{R}):\mathsf{P}_{\xi}(B)=\int_B f_{\xi}(y)\,dy\}$. It is a monotone class that contains the above-mentioned sets. Thus, $\mathcal{C}=\sigma(\{(a,b]:a<b\})=\mathcal{B}(\mathbb{R})$ (see Theorem 1 in Section 2 of the textbook).