How can we show that $\int_{-\infty}^{\infty} f(x) \,df(x) = \frac12$? How can we show that $\int_{-\infty}^{\infty} f(x) \,df(x) = \frac 1 2 $, where $f$ is a continuous probability distribution function?
 A: A fun argument: since $f(x) = \int_{\mathbb{R}}\mathbf{1}_{\{y\leq x\}} d\!f(y)$,
$$
\int_{\mathbb{R}} f(x) d\!f(x)
=\int_{\mathbb{R}} \mathbf{1}_{\{y\leq x\}} d\!f(y) d\!f(x)
= \mathbb{E}[\mathbf{1}_{\{Y\leq X\}}]
= \mathbb{P}{\{Y\leq X\}}
$$
where $X,Y$ are i.i.d. with distribution $f$. By symmetry, since they are i.i.d. and continuous,${}^*$ $\mathbb{P}{\{Y\leq X\}} = \mathbb{P}{\{Y\geq X\}} = 1/2$.

${}^\ast$ The continuity ensures that $\mathbb{P}{\{Y=X\}} = 0$.
A: If $f$ is a continuous CDF then the entity $\int_a^b f(x)df(x)$ is well-defined as a Riemann-Stieltjes integral, and can be evaluated using integration by parts:
$$
\int_a^b f(x)df(x) = f(b)f(b) -f(a)f(a) - \int_a^bf(x)df(x),
$$
from which it follows that
$$\int_a^b f(x)df(x)=\frac{f(b)^2-f(a)^2}2.$$
The value $\frac12$ is obtained as $b\to\infty$ and $a\to-\infty$.
If $f$ is not continuous then the Riemann-Stieltjes integral is not well-defined, because the integrand ($f$) and the integrator (again $f$) will share all points of discontinuity. OTOH the integral $\int_{-\infty}^\infty f(x)df(x)$ makes sense as a Lebesgue-Stieltjes integral when $f$ is a discontinuous CDF, but its value need not equal $\frac12$. For example, if $f(x)$ represents a point mass, then the value of the Lebesgue-Stieltjes integral is $1$.
