a question regarding ch.1 exercise in hatcher algebraic topology the 4th problem in the p.38 of Hatcher algebraic topology says that when X is a union of finitely many closed convex sets, every path in X is homotopic in X to a piecewise linear path. 
But, a union of finitely many closed convex sets is not guaranteed to be a locally star-shaped set... so how to show that  'when X is a union of finitely many closed convex sets, every path in X is homotopic in X to a piecewise linear path.'
 A: Let $X_1, X_2, \dots X_n$ be the closed convex sets, and let $f \colon [0,1] \to X$ be a path. 
We first prove that given any $\alpha \in [0,1)$, there is some $\epsilon > 0$ such that for all $\eta \leq \epsilon$, the restriction of $f$ to $[\alpha,\alpha + \eta]$ is homotopic in $X$ to a linear path via a homotopy that is constant for $t = \alpha$ and $t = \alpha + \eta$. (The analogous fact for intervals $[\alpha - \eta, \alpha]$ is proved similarly for any $\alpha \in (0,1]$.) 
We may assume, without loss of generality, that those $X_i$'s to which $f(\alpha)$ belongs are $X_1, X_2, \dots, X_k$, for some $k \geq 1$. Since $\alpha$ does not belong to the closed set $f^{-1}\left(\bigcup_{i = k + 1}^n X_i\right)$, there is some $\epsilon > 0$ such that the interval $[\alpha,\alpha + \epsilon]$ is disjoint from it. Then, for any $\eta \leq \epsilon$, we have $f([\alpha,\alpha + \eta]) \subseteq \bigcup_{i = 1}^k X_i$.
Now the homotopy
$$H(s,\alpha + u\eta) = 
\begin{cases} 
sf(\alpha + u\eta/s) + (1-s)f(\alpha), &\text{if $0 \leq u \leq s \leq 1$} \\
uf(\alpha + \eta) + (1-u)f(\alpha), &\text{if $0 \leq s \leq u \leq 1$}
\end{cases}$$ 
(where we agree that $H(0,\alpha) = f(\alpha)$) satisfies our requirements. It takes values in $X$ because $f(\alpha) \in \bigcap_{i = 1}^k X_i$, and for each $t \in [\alpha,\alpha + \eta]$, we have $f(t) \in \bigcup_{i = 1}^k X_i$.
Now consider the set $C$ of all numbers $z \in [0,1]$ such that the restriction of $f$ to $[0,z]$ is homotopic to a piecewise linear map, via a homotopy that is constant at the endpoints $t=0$ and $t=z$. Let $m = \sup C$. We have $m > 0$, by the fact we've just proved, taking $\alpha = 0$. Furthermore, we now prove $m \in C$. 
Assume on the contrary that $m \not\in C$. Let $\epsilon > 0$ be given as above for intervals $[m-\eta,m]$ with $\eta \leq \epsilon$. There is some $c \in C$ with $m-\epsilon < c < m$, and by the choice of $\epsilon$, there is an endpoint-preserving homotopy in $X$ of the restriction of $f$ to $[c,m]$ with a linear map. But since $c \in C$, there is also an endpoint-preserving homotopy in $X$ of $f$ restricted to $[0,c]$ with a piecewise linear map. Combining the two homotopies into a single one on $[0,m]$, we see that we must have $m \in C$, a contradiction. Thus $m \in C$.
If we can prove that $m = 1$, this will solve the problem. Assume therefore that $m < 1$. Then the homotopy on $[0,m]$ can again be combined with some homotopy on $[m,m+\epsilon]$, implying that $m + \epsilon \in C$, a contradiction. Thus we have proved $m = 1$, which is what we needed.
