I would like to show the following:
"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$."
After corrections:
Since $f$ is continuous on the open domain $\mathbb{R}$, then we know each $f^{-1}(I_n)$ is open.
Now, for each $k \in K$, there is $\varepsilon_k > 0$ such that $(k - \varepsilon_k, k + \varepsilon_k) \subseteq f^{-1}(I_n)$ for some $n$.
Now, $K \subseteq \bigcup_{k \in K}(k - \varepsilon_k/2, k + \varepsilon_k/2)$. And since $K$ is compact, $K \subseteq \bigcup_{i=1}^{n}(k_i - \varepsilon_i/2, k_i + \varepsilon_i/2)$.
Set $\delta = \min\{\varepsilon_1/2, \dots, \varepsilon_n/2\}$.
Let $x \in K$. Then, $x \in (k_j - \varepsilon_j, k_j + \varepsilon_j)$ for some $j$. Let $t \in (x - \delta, x + \delta)$.
Then, $|t - k_j| \leq |t - x| + |x - k_j| \leq \delta + \varepsilon_j/2 \leq \varepsilon_j/2 + \varepsilon_j/2 = \varepsilon_j$.
Thus, $t \in (k_j - \varepsilon_j, k_j + \varepsilon_j)$.
So, $(x - \delta, x + \delta) \subseteq (k_j - \varepsilon_j, k_j + \varepsilon_j) \subseteq f^{-1}(I_n)$
Therefore, there is a number $\delta > 0$ such that for every $x \in K$, $(x - \delta, x +\delta)$ is contained in $f^{-1}(I_n)$ for some $n$.