$\newcommand{d}{\,\mathrm d}$In your edit, I think you are asking if
$$
\int_{\sin(-\pi)}^{\sin(\pi)} f(x) \d x
= \int_{-\pi}^{\pi} f(\sin(t)) \cos(t) \d t.
$$
The integral on the left evaluates as
$$
\int_{0}^{0} f(x) \d x = 0.
$$
For the integral on the right, notice that $\sin(\pi - t) = \sin(t)$
while $\cos(\pi - t) = -\cos(t)$, so
$f(\sin(\pi - t)) \cos(\pi - t) = -f(\sin(t)) \cos(t).$
We can use this to show that
$$
\int_{0}^{\pi/2} f(\sin(t)) \cos(t) \d t
= -\int_{\pi/2}^{\pi} f(\sin(t)) \cos(t) \d t
$$
and that
$$
\int_{-\pi/2}^{0} f(\sin(t)) \cos(t) \d t
= -\int_{-\pi}^{-\pi/2} f(\sin(t)) \cos(t) \d t
$$
So by writing $\int_{-\pi}^{\pi} f(\sin(t)) \cos(t) \d t$
as the sum of four integrals over the intervals
$[-\pi,-\pi/2]$, $[-\pi/2,0]$, $[0,\pi/2]$, and $[\pi/2,\pi]$,
it comes out to zero.
In the general case, regarding the original question,
no, the function $w$ does not need to be invertible.
We know this because the proof is completed without relying upon any assumption that $w$ is invertible.
Adapting the definite-integral part of the ProofWiki theorem to your choices of names of variables and functions,
Let $w$ be a real function which has a derivative on the closed interval $[a,b]$.
Let $I$ be an open interval which contains the image of $[a,b]$ under $w$.
Let $f$ be a real function which is continuous on $I.$
$$ \int_{w(a)}^{w(b)} f (x) \d x = \int_a^b f(w(t)) w'(t) \d t.$$
If the function $w$ on $[a,b]$ is not invertible then you can find $a'$ and $b'$ in $[a,b]$ such that such that $w(a')=w(b'),$
and the theorem holds when we substitute $a'$ and $b'$ for $a$ and $b.$
Hence we show that the integral of $f(w(t))w'(t)$ over the interval
$[a',b']$ is zero.
What can happen if $w$ is not invertible is that while integrating the right-hand side of the equation from $a$ to $b,$ it happens that $w(t)$ -- which corresponds to $x$ on the left-hand side -- revisits one or more of the values it has already taken. This is not a problem, because the integral between those visits is zero. If you really want, you can replace a non-invertible function $w$ with another function by cutting $w$ into pieces, discarding the "repeating" pieces and translating the remaining pieces so that they define an invertible function over a suitable (smaller) interval.
But you don't have to.
Where you can go wrong with this if you are not careful is that
typically you start with the left-hand side of the equation and
you want to transform it into the right-hand side.
You actually have some given interval of integration $[A,B]$ on the left and you need a function $w$ on some interval $[a,b]$ such that $w(a) = A$
and $w(b) = B,$ along with the other properties specified in the theorem.
It's easy to get tripped up by the part where $w(a) = A$
and $w(b) = B,$ especially since we very often define $w$ implicitly rather than explicitly.
For example (stealing the example shamelessly from another answer with
a few changes in names of variables and functions),
if you try to integrate $\int_{-\pi}^{\pi} g(\sin x) \d x$
using the substitution $t = \sin x$,
you're actually relying on the existence of a function $w$
and an interval $[a,b]$ on which that function is differentiable
such that $w(a) = -\pi$ and $w(b) = \pi$
and such that you can write $x = w(t) = w(\sin x)$.
The problem here
-- which does relate to invertibility, though not in exactly the way you asked --
is that the desired function $w$ simply does not exist.
An obvious candidate is $w(t) = \arcsin(t),$ but that neither allows to write
$w(a) = -\pi$ nor $w(b) = \pi.$
Another candidate is $w(t) = \pi - \arcsin(t),$
since $\sin(\pi - \arcsin(t)) = \sin(\arcsin(t)) = t,$
and this allows you to write $w(b) = \pi$ but not $w(a) = -\pi.$
Yet another candidate, $w(t) = -\pi - \arcsin(t),$
allows you to write $w(a) = -\pi$ but not $w(b) = \pi.$
Where invertibility comes into this is that in order to have a
function $w$ that satisfies the conditions in the theorem,
essentially you are looking for an inverse of the sine function
(to find $x$ such that $t = \sin x$), there is (of course)
no inverse function that can map the range of the sine back
to its entire domain, and there is no differentiable function
that can map the range back to pieces of the domain of the sine
including both $-\pi$ and $\pi.$
If you rewrite the integral as a sum of integrals over
the intervals $[-\pi,-\pi/2]$, $[-\pi/2,\pi/2]$,
and $[\pi/2,\pi]$, then you can use a different $w$ on each
interval and apply the theorem correctly.