Density of a continuous distribution

For a discrete distribution, the density at a point would be the same as it’s probability, but for a continuous distribution (let’s say X exponentially distributed of parameter 1) we cannot do the same thing since all points have probability 0.

In this case, how to we relate the density of the function? (So what would be the density of a continuous function since it can’t be the probability at a point since that would be all 0, and won’t be useful?)

Densities exists by the grace of measures.

Random variable $$X$$ is discrete if and only if a countable set $$S$$ exists with $$P(X\in S)=1$$, and if $$f_X$$ denotes the so-called PMF of $$X$$ i.e. the function with $$f_X(x)=P(X=x)$$ then we can write:$$P(X\in A)=\int_Af_X(x)\;\mu(dx)\tag1$$where $$\mu$$ denotes the so-called counting measure on $$S$$ and is prescribed by: $$A\mapsto|A\cap S|$$Here $$(1)$$ can be rewritten as: $$P(X\in A)=\sum_{x\in A\cap S}f_X(x)\tag2$$

We can say that $$f_X$$ is a density with respect to this counting measure.

In the case of absolutely continuous distributions we also have a density with respect to a measure, but this time the so-called Lebesgue measure and get:$$P(X\in A)=\int_Af_X(x)\;\lambda(dx)$$ where $$\lambda$$ denotes the Lebesgue measure.

What lacks here is a possibility to rewrite as we did in $$(2)$$, but further it is the same thing only with measures of another kind.

Actually the density must be looked at as a link between the probability measure and a (suitable) other measure.

It happens seldom that other measures than the suitable counting measures or Lebesgue measures are applied.