The question can be rephrased. The composition of f with a piece-wise differentiable function, g, is piecewise differentiable. The derivative of a piece-wise differential function is also piece-wise continuous by definition. And the limits of integration make this an improper integral. So the question is, under these conditions, can we take the improper integral. We also have that one of the functions is the derivative if the internal member of a pair of composed functions.
Suppose we have F(u) where u=g(x). Then by the chain rule, we have
$F'(x)=F'(g(x))g'(x)$ if applicable in the case that g is piece-wise differentiable. And let's suppose $f(u)=F'(u)$
Then if we have $\int f(g(x))g'(x)dx=\int F'(g(x))g'(x)dx=\int f(u) du=F(g(x))+c$
The standard rules of improper integration apply.
So I think everything hangs on 2 questions. Does the chain rule apply in the case of f(g(x)) if g is only piecewise differentiable? Can you take the improper integral of the product of a piece-wise differentiable function and a piece-wise continuous function?
The usual theorem for proving the chain rule should apply in the first case. Piece-wise integration should be available in most books addressing the issue.
https://en.wikipedia.org/wiki/Subderivative has references that seem promising.
What is d/dx[f(g(x))] if g is piecewise continuous?
$\lim_{\Delta x->\infty} \frac{f(g(x+\Delta x)-f(g(x))}{\Delta x}=\lim_{\Delta x} \frac{f(g(x+\Delta x))-f(g(x))}{g(x+\Delta x)-g(x)}\frac{g(x+\Delta x)-g(x)}{\Delta x}$
We have that g is piecewise differentiable. This means that the limit of the right factor in the right equation doesn't exist at select points. The left factor has problems if f has any discontinuities.
I take this to mean that the chain rule is applicable on the sub intervals in which g is differentiable and f is continuous.
The absolute integrability of f need not imply continuity, correct? Means continuous except at countably many points as I recall.
From links below, it appears substiution is permitted within the sub intervals on which g is differentiable.
The behavior of g at those points of discontinuity of its derivative could inject some misbehavior.