Show that continuous functions on $\mathbb R$ are Borel-measurable Here are my thoughts. We want to show that $f^{-1}$ maps Borel sets to Borel sets.
Let $f:\mathbb R\to\mathbb R$ be a continuous function and $\mathcal B(\mathbb R)$ a Borel $\sigma$-algebra. Let $B\in\mathcal B(\mathbb R)$ and $B$ open. Then $f^{-1}(B)$ is open as well, that is, there exists neighborhoods around every point of $f^{-1}(B)$ contained within. Since these neighborhoods are members of $\mathcal B(\mathbb R)$, their union are also members of $\mathcal B(\mathbb R)$. Hence $f^{-1}(B)$ is a member of $\mathcal B(\mathbb R)$.
Here's where I'm stuck. I don't know how to show countably many such members can have their unions taken to give me $f^{-1}(B)$. I also don't know what to do with the closed sets in $\mathcal B(\mathbb R)$, especially singletons and those only generatable via complements.
Hints?
 A: You need to establish the following lemma:

Let $(X,\Sigma),(Y,\mathrm{T})$ be measurable spaces. Suppose that $\mathrm{T}$ is generated by $\mathcal{E}$. A mapping $f:X \to Y$ is $(\Sigma,\mathrm{T})$-measurable if and only if $$\forall E \in \mathcal{E}, f^{-1}[E] \in \Sigma$$

Proof: The only if part is trivial. For the other direction, observe that the $\sigma$-algebra generated by the set $\{S \subseteq Y\mid f^{-1}[S] \in \Sigma\}$ contains $\mathcal{E}$, so it also contains $\mathrm{T}$.
By substituting $\Sigma,\mathrm{T}$ with the Borel sets, and $\mathcal{E}$ with the open sets (a.k.a. topology) on $\mathbb{R}$, the proof is complete.
A: This relies basically on the fact that inverse functions respect all three set operations: arbitrary unions, arbitrary intersections and complements.  In other words $f^{-1}(\cup B_\alpha)=\cup f^{-1}(B_\alpha)$, $f^{-1}(\cap B_\alpha)=\cap f^{-1}(B_\alpha)$ and $f^{-1}(A^c)=(f^{-1}(A))^c$.  All three of these are pretty easy to prove.  Incidentally functions going forwards only respect unions, while inverse is much better behaved.
A: One thought that helped me understand the statement, and may be useful is:
Let $f:\mathbb R\to\mathbb R$ be a continuous function and $\mathcal B(\mathbb R)$ a Borel $\sigma$-algebra. The ($b$,+$\infty$) is an open set (It can be written as $\cup^{\infty}_{n=1}$B($x_0$,$\epsilon$$_x$)) therefore ($b$,+$\infty$)$\in$ $\mathcal B(\mathbb R)$. Then [-$\infty$,$b$] = $\mathbb R$$\setminus$($b$,+$\infty$) = ($b$,+$\infty$)$^c$$\in$ $\mathcal B(\mathbb R)$ (because it is a $\sigma$-algebra).
We already know that $f$=continuous and [-$\infty$,$b$] = closed $\in$ $\mathcal B(\mathbb R)$ $\Rightarrow$ $f$$^{-1}$([-$\infty$,$b$]) = closed $\in$ $\mathcal B(\mathbb R)$ and since* [$f$ $\leq$ $b$] = $f$$^{-1}$([-$\infty$,$b$])$\in$ $\mathcal B(\mathbb R)$ then the "$f$", by definition, is Borel-measurable.
PS1:* [$f$ $\leq$ $b$] = $f$$^{-1}$([-$\infty$,$b$]) = {$x$$\in$$\mathbb R$: $f(x)$ $\leq$ $b$}.
