# Does there exist any probability density function ‎$‎f:‎\mathbb{R}\to‎\mathbb{R}‎$ ‎which is not Riemann integrable?

Let‎ ‎$$‎‎f:‎\mathbb{R}\to‎\mathbb{R}‎$$ be a probability density function. Can ‎the following be happened for ‎$$‎‎f$$?

(1) ‎‎$$‎‎f$$ ‎is ‎not ‎integrable ‎on ‎an ‎(some) ‎interval ‎of ‎‎$$\mathbb{R}‎$$.

‎(2) ‎‎$$‎‎f$$ ‎is ‎not ‎integrable ‎on every closed ‎interval ‎of ‎‎$$\mathbb{R}‎$$.‎‎‎ ‎ I know that ‎if $$‎f‎$$ ‎is a‎ ‎‎probability density function then

(1) ‎$$‎‎f(x)‎\geq‎0 ‎\quad‎\text{for all} \; x$$,

(2) ‎$$\int_{-‎\infty‎}^{+\infty}f(x)\,dx=1$$.

but ‎here ‎we ‎have‎ Lebesgue integral not Riemann integral. Moreover if ‎$$‎‎f$$ ‎wants ‎to ‎be‎ Riemann integrable on the whole $$\mathbb{R}‎$$, it must hold in the following conditions

‎‎(a) ‎‎$$‎‎f$$ ‎is ‎integrable ‎on every closed ‎interval ‎of ‎$$\mathbb{R},‎$$

(b) the following integral is convergent‎

$$\int_{-‎\infty‎}^{+\infty}f(x)\,dx=‎‎\int_{-‎\infty‎}^{0}f(x)\,dx+\int_{0‎}^{+\infty}f(x)\,dx.$$

According the mentioned things, the most pdf are ‎ Riemann integrable, and I could not find any example as I asked. Would anyone help me to find that. thanks a lot. ‎

• Take $X\sim U[0,1]$. Then $g=1-1_{\mathbb{Q}}$ is a version of $f_X$...
– user140541
Commented Dec 20, 2018 at 7:37

It is known that there exists a measurable set $$E$$ in $$\mathbb R$$ such that $$0 for every open interval $$I$$. If $$f=\frac {I_E} {m(E)}$$ then $$f$$ is a density function but it is not continuous at any point so it is not Riemann integrable on any interval.

For the construction of such a set $$E$$ see Creating a Lebesgue measurable set with peculiar property.

It is easy give simpler examples where $$f$$ is almost everywhere equal to a Riemann integrable function but it is not itself Riemann integarble. In probability theory density function which are equal almost everywhere lead to the same distribution, so I tried to give a example which is not almost everywhere equal to a Riemann integrable function.

• This is very nice since, also, $f$ is not a.e. equal to a Riemann integrable function. Commented Dec 20, 2018 at 7:44
• This is a very interesting example. Is the existence of such a set $E$ easy to prove? Commented Dec 20, 2018 at 8:27
• I have added a reference for that construction. @BigbearZzz Commented Dec 20, 2018 at 8:51

$$f(x) = \begin{cases} 0 &; x\in\Bbb Q \cap[0,1] \\ 1 &; x\in\Bbb Q^c \cap[0,1] \end{cases}$$ is a probability density function that is not Riemann integrable.

If you want a density function that is not Riemann integrable on any interval in $$\Bbb R$$ then you can take $$f$$ to be the (normalized) Gaussian distribution and then $$f+\mathbf 1_{\Bbb Q}$$ is the desired probability density function with the properties you want.