How can we prove $\int_a^bf\:{\rm d}g=\int_a^bf(s)g'(s)\:{\rm d}s$ if $g'$ is not continuous? Let $a,b\in\mathbb R$ with $a<b$, $$\mathcal D_{[a,\:b]}:=\{(t_0,\ldots,t_k):k\in\mathbb N\text{ and }a=t_0<\cdots<t_k\}$$ and $$\mathcal T_\varsigma:=\{(\tau_1,\ldots,\tau_k):\tau_i\in[t_{i-1},t_i]\text{ for all }i\in\{1,\ldots,k\}\}\;\;\;\text{for }\varsigma=(t_0,\ldots,t_k)\in\mathcal D_{[a,\:b]}.$$ Moreover, let $f:[a,b]\to\mathbb R$ be continuous and $g:[a,b]\to\mathbb R$ be of bounded variation. We can show that $$\int_a^bf\:{\rm d}g:=\lim_{\substack{|\varsigma|\to0+\\\varsigma\in\mathcal D_{[a,\:b]}\\\tau\in\mathcal T_\varsigma}}S_{\varsigma,\:\tau}(f,g)$$ is well-defined, where $$|\varsigma|:=\max_{1\le i\le k}(t_i-t_{i-1})\;\;\;\text{for }\varsigma=(t_0,\ldots,t_k)\in\mathcal D_{[a,\:b]}$$ and $$S_{\varsigma,\:\tau}(f,g):=\sum_{i=1}^kf(\tau_i)(g(t_i)-g(t_{i-1}))\;\;\;\text{for }\varsigma=(t_0,\ldots,t_k)\in\mathcal D_{[a,\:b]}\text{ and }\tau\in\mathcal T_\varsigma.$$

Assuming that $g$ is differentiable (not necessarily continuously differentiable), are we able to show that $$\int_a^bf\:{\rm d}g=\int_a^bf(s)g'(s)\:{\rm d}s\tag1?$$

Let $\varsigma=(t_0,\ldots,t_k)\in\mathcal D_{[a,\:b]}$. By the mean value theorem, there is a $\tau\in\mathcal T_\varsigma$ with $$S_{\varsigma,\:\tau}(f,g)=\sum_{i=1}^kf(\tau_i)g'(\tau_i)(t_i-t_{i-1})=S_{\varsigma,\:\tau}(fg',\operatorname{id}_{[a,\:b]})\tag2,$$ but does the right-hand side tend to the right-hand side of $(1)$ as $|\varsigma|\to0+$? This is clearly the case when $g'$ is continuous though ...
 A: The following claims hold:

Theorem 1. Let $g$ be absolutely continuous on $[a, b]$, and let $f$ be continuous on $[a, b]$. Then $fg'$ is Lebesgue integrable and
$$ \int_{a}^{b} f(t) \, \mathrm{d}g(t) = \int_{a}^{b} f(t)g'(t) \, \mathrm{d}t. $$

The proof is quite simple. Starting from the fact that $\int_{c}^{d} g'(t) \, \mathrm{d}t = g(d) - g(c)$ for any interval $[c, d] \subseteq [a, b]$ (where we utilized the absolute continuity of $g$), the statement holds when $f$ is a step function. Then the desired claim follows by choosing a sequence of step functions that converges uniformly to $f$. This reasoning in fact shows that the statement remains true if $f$ is a uniform limit of step functions, i.e., regulated functions.
Also, if the left-hand side is understood as the Lebesgue–Stieltjes integral sense, then the equality holds for any $f$ that is integrable with respect to the measure $|g'(t)| \, \mathrm{d}t$. This is because the above statement reduces to an instance of the Radon–Nikodym theorem. This opens up possibilities of further generalizing the above claim.
We also have:

Theorem 2. Let $g$ be differentiable everywhere on $[a, b]$, and let $f$ be both Riemann–Stieltjes integrable with respect to $g$ and Lebesgue integrable on $[a, b]$. Then $fg'$ is Henstock–Kurzweil integrable and
$$ \int_{a}^{b} f(t) \, \mathrm{d}g(t) = \int_{a}^{b} f(t)g'(t) \, \mathrm{d}t, $$
where the right-hand side is in Henstock–Kurzweil integral sense.

The Henstock–Kurzweil integral can be thought as a non-absolutely convergent version of the Lebesgue integral, in the sense that a function $f$ is Lebesgue integrable if and only if both $f$ and $|f|$ is Henstock–Kurzweil integrable.
The proof is also straightforward, assuming basic theory of all the types of integral mentioned above. Indeed, for each $\varepsilon > 0$, we do the following:

*

*Let $\varepsilon' = \frac{\varepsilon}{\int_{a}^{b} |f|+2}$. Since $f$ is Lebesgue integrable, this is still a positive number.


*Choose a number $\delta_1 > 0$ such that $\left| S(f, g, \dot{\mathcal{P}}) - \int_{a}^{b} f \, \mathrm{d}g \right| < \varepsilon'$ for any tagged partition $\dot{\mathcal{P}}$ with mesh size $ < \delta_1$. This is possible since $f$ is Riemann–Stieltjes integrable with respect to $g$.


*Choose a gauge $\delta_2$ satisfying the straddle lemma for $g$ and $\varepsilon'$: For any $t \in [a, b]$ and $u, v \in [a, b]$ satisfying $t - \delta_2(t) < u < t < v < t + \delta_2(t)$,
$$ |g(v) - g(u) - g'(t)(v - u)| \leq \varepsilon' (v - u). $$


*Choose a gauge $\delta_3$ such that $\left| S(|f|, \dot{\mathcal{P}}) - \int_{a}^{b} |f| \right| < 1$ for any $\delta_3$-fine tagged partition $\dot{\mathcal{P}}$. This is possible because $|f|$ is Lebesgue integrable and hence Henstock–Kurzweil integrable.
Now let $\delta(t) = \min\{\delta_1, \delta_2(t), \delta_3(t)\} $. Then $\delta_3$ is also a gauge, and for any $\delta$-fine tagged partition $\dot{\mathcal{P}}$ of $[a, b]$,
\begin{align*}
\left| \int_{a}^{b} f \, \mathrm{d}g - S(fg', \dot{\mathcal{P}}) \right|
&\leq \left| \int_{a}^{b} f \, \mathrm{d}g - S(f, g, \dot{\mathcal{P}}) \right|
+ \left| S(f, g, \dot{\mathcal{P}}) - S(fg', \dot{\mathcal{P}}) \right| \\
&< \varepsilon' + \sum_{i} |f(\tau_i)| \cdot |g(t_i) - g(t_{i-1}) - g'(\tau_i)(t_i - t_{i-1})| \\
&\leq \varepsilon' + \varepsilon' \sum_{i} |f(\tau_i)| (t_i - t_{i-1}) \\
&\leq \varepsilon' + \varepsilon' \left( 1 + \int_{a}^{b} |f| \right) \\
&= \varepsilon.
\end{align*}
Therefore the desired claim follows.
A: $\int_{a}^{b} f(x)  dg= \int f(x)\frac{dg}{dx} dx =\int_{a}^t f(x) g'(x) dx+\int_{t}^{b} f(x) g'(x) dx,$
where $g'(x)$ has a finite jump discontinuity at $x=t$.
Edit:
For example let $f(x)=x, g(x)=|x|$, then g'(x)= \text{sgn}(x) is discontinuous at $x=0$, so we have
$I=\int_{-1}^2 x d|x|= \int_{-1}^{2} x \frac{d|x|}{dx} dx=\int_{-1}^{2} x ~\text{sgn}(x)~ dx= \int_{-1}^{0} x (-1) dx+ \int_{0}^{2} x.1 dx=\frac{1}{2}+2=\frac{5}{2}.$
