$f$ a real, continuous function, is it measurable?

Let $f: \mathbb{R} \to \mathbb{R} $ be a continuous function. I need to show that is a measurable function.

I tried working with the definition: Let $f: X \to \mathbb{R}$ be a function. If $f^{-1}(O)$ is a measurable set for every open subset $O$ of $\mathbb{R}$, then $f$ is called a measurable function.

Since $f^{-1}(O)$ also lies in $\mathbb{R}$, I think it is sufficient to show that every subset of $\mathbb{R}$ is measurable. But is this possible?

So far I concluded that $\mathbb{R}$ itself is measurable, since $$\mu(A) = \mu(A \cap \mathbb{R}) + \mu(A \cap \mathbb{R}^c) = \mu(A) + \mu(\emptyset) = \mu(A).$$ How do I need to approach?


Since $f$ is continuous $f^{-1}(O)$ is open if $O$ is open. Open sets are measurable (if the space is equipped with the $\sigma$-algebra of the Borel-sets) so you are ready.

addendum:

It would indeed be sufficient if every subset of $\mathbb R$ was Borel-measurable, but that is not the case. For that see the comments on your question.