Let $X$ be a compact Hausdorff space and let $C(X,I)$ be the set of all continuous functions from $X$ into the closed interval $[0,1]$. If we equip $C(X,I)$ with the the topology of uniform convergence is $C(X,I)$ compact? I'm inclined to think not, but I can't think of a simple counterexample.
$C(X,I)$ is the closed ball of radius $1/2$ centred at the constant function $1/2$ in the Banach space $C(X,\mathbb R)$. A closed ball of nonzero radius in a Banach space is compact if and only if the Banach space is finite-dimensional. $C(X,\mathbb R)$ is infinite-dimensional. Therefore $C(X,I)$ is not compact.