What is the difference between Riemann and Riemann-Stieltjes integrals?

It seems to me that you are integrating relative to a $dg(x)$, rather than $dx$. For example, the if $g(x)$ is $0$ for negative $x$ and $1$ for positive $x$, then then $\int_{-1}^{1} f(x)dg(x)$ is $f(0)$ if $f$ is continuous.

If $g(x)=x$, the Riemann-Stieltjes integral is just the Riemann integral.

If $g(x)$ is continuously differentiable, then the RS-integral $\int_{a}^{b} f(x)dg(x)$ is the same as the Riemann integral $\int_a^b f(x)g'(x) dx$.

The differences then are the cases where $g(x)$ is not continuously differentiable. For example, if $g(x)$ is the step function above, then $dg(x)$ is "like" the Dirac delta function.

It's a beginning of a way of thinking of integrals as operators.