$h,h':X\to Y$ are homotopic and $k,k':Y\to Z$ are homotopic, then $k\circ h$ and $k'\circ h'$ are homotopic. I want to show that if $h,h':X\to Y$ are homotopic and $k,k':Y\to Z$ are homotopic, then $k\circ h$ and $k'\circ h'$ are homotopic.

This means that there is a continuous map $F_1:X\times I \to Y$ such that:
$F_1(x,0)=h(x)$ and $F_1(x,1)=h'(x)$
and a continuous map $F_2:Y\times I \to Z$
$F_2(y,0)=k(y)$ and $F_2(y,1)=k'(y)$

We know that $k\circ h$ and $k'\circ h'$ are both continuous, since the composition of continuous maps is a continuous map(open set in $Z$ is open in preimage, inside of $Y$, open in preimage inside of $X$ etc).
We need to show these are homotopic: 
I.e. we want, $F_3:X\times I \to Z$ with $F_3(x,0)=(k\circ h)(x)$ and $F_3(x,1)=(k'\circ h')(x)$

I have seen the answer here: Given two pairs of homotopic functions $h,h'$ and $k,k'$, are the respective compositions $k \circ h$ and $k' \circ h'$ homotopic?
But I am unsure how this was obtained, and honestly, a little confused by it.
 A: Consider $\widehat{F}_1:X\times I\longrightarrow Y\times I$ such that the projection to the first factor is the just homotopy $F_1$ and the mapping $(x,t)\longmapsto t$ is the projection to the second factor. Then, consider the composition $G:=F_2\circ\widehat{F}_1:X\times I\longrightarrow Z$ where $(x,t)\longmapsto F_2(F_1(x,t),t)$.
Observe that: $G(x,0)=F_2(F_1(x,0),0)=F_2(h(x),0)=k\circ h(x),$ and $G(x,1)=F_2(F_1(x,1),1)=F_2(h'(x),1)=k'\circ h'(x)$, by definition.
By hyphotesis, $F_1,F_2$ are both continuous, moreover the function $\widehat{F}_1$ is continuous, so the compositions $G$ will be continuous too.
Clearly the functions $h,h',k,k'$ are continuous and $G$ define the homotopy function between $k\circ h$ and $k'\circ h'$.
A: You can do this by employing the fact that the relation of homotopy is transitive: 


*

*First show that $k \circ h$ and $k' \circ h$ are homotopic; 

*Next show that $k' \circ h$ and $k' \circ h'$ are homotopic; 

*Then you may conclude that $k \circ h$ and $k' \circ h'$ are homotopic.


Using the given homotopy $F_2$ from $k$ to $k'$, a homotopy from $k \circ h$ to $k' \circ h$ is given by
$$(x,t) \mapsto F_2(h(x),t)
$$
Next, using the given homotopy $F_1$ from $h$ to $h'$, a homotopy from $k' \circ h$ to $k' \circ h'$ is given by
$$(x,t) \mapsto k'(F_1(x,t))
$$
If you really, really want to see a formula for a homotopy from $k \circ h$ to $k' \circ h'$, you can use the proof that the relation of homotopy is transitive. This fact is proved by "concatenating" homotopies. Concatenating the homotopy $F_2(h(x),t))$ with the homotopy $k'(F_1(x,t))$ is done in a manner very similar to concatenating paths, namely:
$$(x,y) \mapsto F_2(h(x),2t) \quad \text{if $0 \le t \le \frac{1}{2}$}
$$
$$(x,y) \mapsto k'(F_1(x,2t-1)) \quad \text{if $\frac{1}{2} \le t \le 1$}
$$
