Riemann-Stieltjes Integration problem I have two functions $f$ and $g$ and I need to show that $f$ is Riemann-Stieltjes integrable with respect to $g$. I was able to calculate the integral, but I'm not sure how to actually prove why it is Riemann-Stieltjes integrable.
Let
\begin{align*}
f(x) &=x^2 \qquad x \in [0,5]\\
\\
g(x) &=\left\{ 
\begin{array}{ll} 
0 & \textrm{if }0 \leq x<2 \\
 p & \textrm{if } 2 \leq x<4 \\
 1 & \textrm{if } 4 \leq x \leq 5
\end{array} \right.
\end{align*}
After calculating the integral I got it equal to $16-12p$. Now how do I go about actually proving this? Or have I already done so?
 A: Note that $f$ is Riemann-Stieltjes integrable with respect to $g$ if for every $\epsilon > 0$ there exists a partition $P_\epsilon$ with
$$U(P_\epsilon,f,g) - L(P_\epsilon,f,g) < \epsilon,$$
where $U$ and $P$ are upper and lower sums, respectively:
$$U(P_\epsilon,f,g)= \sum_{k=1}^{n}\sup_{x \in [x_{k-1},x_k]}f(x)[g(x_k)-g(x_{k-1})]\\=\sum_{k=1}^{n}x_k^2[g(x_k)-g(x_{k-1})],\\L(P_\epsilon,f,g)= \sum_{k=1}^{n}\inf_{x \in [x_{k-1},x_k]}f(x)[g(x_k)-g(x_{k-1})]\\=\sum_{k=1}^{n}x_{k-1}^2[g(x_k)-g(x_{k-1})].$$
Choose any partition that includes subintervals $[2-\delta,2]$ and $[4-\delta,4]$ with $0<\delta < 2.$
Then 
$$U(P_\epsilon,f,g) - L(P_\epsilon,f,g) = 2^2(p-0) + (4)^2(1-p) - (2-\delta)^2(p-0) - (4-\delta)^2(1-p)\\=16-12p- (2-\delta)^2p-(4-\delta)^2(1-p).$$
The RHS can be made smaller than $\epsilon$ by choosing $\delta$ sufficiently small.
Using the same partition, the upper sum and lower sum each approximate the integral to any desired accuracy by choosing $\delta$ sufficiently small.  In this case the upper sum is $16 - 12p$, the exact value of the integral, regardless of $\delta$.
A: Because $f$ is continuous, it is sufficient to show that $g$ is of bounded variation (equivalently: $g$ is the difference of two monotone functions).
