Let $f$: $\mathbb{R}\to\mathbb{R}$ be a continuous function. Suppose that $K$ is a compact subset of $\mathbb{R}$, and $f(K)$ $\subseteq$ $\bigcup_{n=1}^{\infty} I_n$, where each $I_n$ is an open interval. Prove that there is a number $\delta > 0$ that for every $x \in K$, $(x - \delta, x + \delta)$ is contained in $f^{-1}(I_n)$ for some $n$.
I will post my suggested proof as an answer. If incorrect, please comment.