Solution (source code)

= Solution

A space is connected when it has no separation into two nonempty disjoint open sets; the connected subspaces of $\mathbb R$ are exactly the intervals. A space is path connected if every two points are joined by a continuous path. A separation would pull back along a path to a separation of $[0,1]$, so path connectedness implies connectedness.

Each of the $n$ interval components of $I_n$ must map into one of the $m$ components of $I_m$. This assignment is constant on every connected component of the uniform function space. Conversely, for a fixed assignment, straight-line interpolation within each target interval gives paths between maps. Hence
$$
\boxed{C(I_n,I_m)\text{ has }m^n\text{ connected components}.}
$$