Let $P$ a probability over $(\Bbb R, \mathcal B)$ where $\mathcal B$ are Borel set, $f:\Bbb R \to \Bbb R$, $f\geq 0$ almost everywhere s.t. $\forall a<b$ rational $$P([a,b]) = \int_a^bf(x)dx$$ This implies that $P$ has $f$ as a density function.
$f$ density function for $P$ means that $f:\Bbb R \to [0,\infty)$ borel measurable function and $$P(A) = \int_Af(x)dx $$ for all $A$ borelian sets.
I know a characterization that
$$\boxed{f \ \text{density for some} \ P\iff \int_\Bbb R f(x)dx =1}$$
For $P$ to admit $f$ as density $f$ should be a density so
$$\int_{\Bbb R}f(x)dx
= \int_0^{\infty}f(x)dx+ \int_{-\infty}^0f(x)dx \\
=\sum_{n=0}^\infty \bigg(\int_n^{n+1}f(x)dx+ \int_{-n-1}^{-n}f(x)dx \bigg)\\
=\sum_{n=0}^\infty (P([n,n+1])+P([-n-1,-n]))\\
=P[0,\infty) + P(-\infty, 0] = P(\Bbb R) =1$$
So $f$ is a density for some probability over $\Bbb R$. Now (supposing what I've done right) I wold like to use cumulative distribution function to prove that $f$ is $P$'s density, but I'm not very sure on how to proceed, thank you for the help!