[1]:http://groupoids.org.uk/images/compactopen2.jpg
[1x]:https://i.sstatic.net/xXvZGm.jpg

I have a weakness for pictures. So here is one 

![function][1x] [<sup>(source)</sup>][1]

The above shows a function $f: \mathbb  R \to \mathbb R$, a  compact set $C$, and an open set $U$. The condition $f(C) \subseteq U$ is that the graph of $f$ passes through the shaded part shown in the picture.