TITLE: Is expectation Riemann-/Lebesgue–Stieltjes integral?
QUESTION [8 upvotes]: In probability theory,  when having $    E(f(X))=\int_{-\infty}^\infty f(x)\, dg(x) $, an expectation of a measurable function $f$ of a random variable $X$ with respect to its cumulative distribution function $g$,

is it true that it is always a
Lebesgue–Stieltjes integral?
Furthermore, is it always a
Riemann–Stieltjes integral?

Thanks and regards!

REPLY [4 votes]: This question is closely related to your other question regarding Riemann-Stieltjes integrals. 
In the case that $f$ is continuous, these two types of integral agree provided they are finite.
But there are also other cases. For instance, $f$ is merely Borel measurable, then the Lebesgue-Stieltjes integral $\int f(x) dg(x)$ is defined, but not Riemann-Stieltjes integral because $f$ might be unbounded.  This still have probabilistic interpretation because in this case $f(X)$ is still a random variable, and we can still consider the expectation of $f(X)$.

REPLY [3 votes]: It maybe better for you to use the notation
$$
\mathsf{E}[f(X)] = \int\limits_{\mathbb{R}}f(x)Q(dx)
$$
where $Q$ is a distribution of an r.v. $X$. Then you do not need to worry if $X$ is a continuous r.v. or a discrete one. Then depending on what you know about $X$ (sumulative distribution function $g$ or a density function $h$) you will rewrite the first equation using
$$
Q(dx) = dg(x) = h(x)\,dx.
$$
Usually only Lebesgue (Lebesgue-Stieltjes) integrals are used in the probability theory. On the other hand to calculate them you can use an equivalence of Lebesgue-Stieltjes and Riemann-Stieltjes integrals (provided necessary conditions).
Edited: For the discrete distribution CDF $g$ is a pure jump function with jumps at values $\alpha_i$ of the r.v. $X$ and sizes of jumps $p_i$ such that $p_i = \mathsf{P}(X = \alpha_i)$. Then the integral is again a Lebesgue integral above can be rewritten as a Lebesgue-Stieltjes integral using $g$ or as a sum.