For every interval $[a,b]$, there exists a uniform probability density over this interval, which is the constant function $f(x)=\frac{1}{|a-b|}$ for $a < x < b$, and $f(x)=0$ for all other $x$.
Now it's clear that there is no ordinary probability density which is constant on all of $\mathbb{R}$ which also has integral $1$. (The height of such a function would have to be infinitesimally small.)
However, it seems to me as if the Dirac-Delta $\delta_x$ has very similar problems: It is conceptually a function that is infinitely thin but still has integral $1$.
In the Dirac-Delta case, one could solve the issue by generalizing the definition of a function and defining $\delta$ not as a function, but as a Schwartz distribution.
So my question is: Is there some way, for example by generalizing some definition somewhere, to get a function that acts like a uniform probability density over the real numbers, i.e. when multiplied with any other density $f$ the resulting density will be equal to $f$ (up to a constant factor)?