Proving Path-Connectedness I am working on a homework question that gives $A \subseteq X$ and three points $x, y, z \in A$.  Suppose also that there are continuous functions $f, g : [0,1] \to X$ with $f([0,1]) \subseteq A$, $f(0)=x$, $f(1)=y$ and $g([0,1]) \subseteq A$, $g(0)=y$, $g(1)=z$. I am asked to show that there is a function $h:[0,1] \to X$ with $h([0,1]) \subseteq A$, $h(0)=x$, and $h(1)=z$. 
I think I have proved that $h(0)=x$ and $h(1)=z$, but I am not sure how to prove $h([0,1]) \subseteq A$. So far, I have attempted to have $h=f+g$ and use the triangle inequality to show that $d(x,z) < d(f(0),g(1))$ and say that this implies $h([0,1]) \subseteq A$. To be honest, I am not sure that this is the correct way to do this. Any help or advice would be appreciated.
 A: Imagine that the parameter in each of the paths measures time, so for instance, from time $t = 0$ to time $t = 1$, a point moves from $x$ to $y$ according to the function $f$, all the while staying within $A$.
The function $g$ parametrized a path from $y$ to $z$ during that same time interval.  But what if we delayed the start of $g$ so that it ran from $t = 1$ to $t = 2$?  Then, we would have a point moving from $x$ to $y$ during $[0, 1]$ and from $y$ to $z$ during $[1, 2]$.  Here's a piecewise formula for such a path, where I have deliberately chosen to call the variable $s$:
$$
k(s) = \begin{cases}
f(s) & 0 \le s \le 1 \\
g(s - 1) & 1 \le s \le 2
\end{cases}
$$
This function almost satisfies all your criteria.  Do you see why $k([0, 2]) \subseteq A$, for example?  The one issue with $k$ is that although it gets the point from $x$ to $z$, it takes too long!  There's a simple solution:  run the filmstrip of $k$ at double speed.
Let $s = 2t$.  The resulting function $h: [0, 1] \to A$ has formula
$$
h(t) = \begin{cases}
f(2t) & 0 \le t \le \frac{1}{2}\\
g(2t - 1) & \frac{1}{2} \le t \le 1
\end{cases}
$$
does the job nicely.
