A topological argument from tom Dieck: paths and interiors This is from Algebraic Topology by Tammo tom Dieck, page 45.

Let $X_0$ and $X_1$ be subspaces of a topological space $X$ whose interiors cover $X$: $X = \mathrm{int}(X_1)\cup\mathrm{int}(X_2)$. Let $w\colon [0,1]\to X$ be a path. Then there exists a decomposition $0 = t_0 < t_1 < ... < t_{m+1} = 1$ such that $w([t_i,t_{i+1}]) \subseteq \mathrm{int}(X_j)$. Choose $\gamma\colon \{0,...,m\}\to \{0,1\}$ such that $w([t_i,t_{i+1}]) \subseteq \mathrm{int}(X_{\gamma(i)})$.

Can someone explain this to me? I'm not sure what is happening here. For starters, why there exists such decomposition? Second, assuming that it does, why we can choose this $\gamma$?
 A: This is a compactness argument. If we let $U_i=w^{-1}(\text{int}\,X_i)$
($i\in\{0,1\}$) then $[0,1]=U_0\cup U_1$. This is an open covering of the compact
set $[0,1]$ so has a Lebesgue number $\delta>0$. This means that each subset of
$[0,1]$ with diameter $<\delta$ is contained in $U_0$ or in $U_1$. Choose
$0=t_0<\cdots<t_{m+1}=1$ such that each $t_{j+1}-t_j<\delta$. Then for
each $j$, $w([t_j,t_{j+1}])$ is a subset of either $\text{int}\,X_0$
or of  $\text{int}\,X_1$.
A: The main gist is that $[0,1]$ is compact. Since $w$ is continuous, $w^{-1}(\operatorname{int}(w_0))$ and $w^{-1}(\operatorname{int}(w_1))$ are open and hence we can write $$ w^{-1}(\operatorname{int}(w_j)) = \bigcup_{i \in I} (a_i, b_i) \cap [0,1] $$ for $j = 1,2$. So $[0,1]$ is the union of such open sets. By compactness, we can choose finitely many. I'll leave it to you to tweak them to closed intervals (just choose intersection points).
The existence of your $\gamma$ immediately follows from the $t_0 < \dots < t_{m+1}$ you assign. So e.g. if $w([t_0, t_1]) \subseteq \operatorname{int}(X_1)$, then we assign $\gamma(0) = 1$.
A: The second fact is just a reformulation in more formal notation of the first:
suppose we have $0 = t_0 < t_1 < t_2 < \ldots < t_{m+1}=1$ such that 
(for each applicable $j$) $w([t_j, t_{j+1}]) \subseteq \operatorname{int}(X_j)$ for some $j$ (so either that part of the path lies "well inside" $X_0$ or "well inside" $X_2$. The second part just introduces the notation $\gamma(j)$ for the part in which the image of $[t_j, t_{j+1}]$ lies. Part 1 already says there is a well-defined subset for each $j$ ($j$ can be $0,1,\ldots,m$) and the final part assigns the index of that set ($1$ or $2$) a name $\gamma(j)$ (or $\gamma(i)$ as it switches from $j$ to $i$ indices..) No more than that.
To find the domain points $t_1,\ldots, t_m$ we can use a Lebesgue number argument (clean!), or we could reason as follows: for $t_0=0$ we know that $w(t_0) \in \operatorname{int}(X_i)$ for some $i=1$ or $2$. Now we could have that $w([0,1]) \subseteq \operatorname{int}(X_i)$ for that $i$ and then we're done, $m=0$ and $\gamma(0)=i$. Otherwise there is some $u$ such that $w(u) \notin \operatorname{int}(X_i)$ and we can define $u_0 = \min \{t: t \notin \operatorname{int}(X_i) \}$ and $t_1 = \sup\{t \mid t \le u_0: w(t) \in \operatorname{int}(X_i)\}$ etc. By compactness we cannot switch between sets infinitely many times. It's more messy, but might give you an idea.
