Show that a continuous function $f: [0,\frac{1}{2})\cup(\frac{1}{2},1] \to \mathbb{R}$ is measurable. Show that a continuous function $f: [0,\frac{1}{2})\cup(\frac{1}{2},1] \to \mathbb{R}$ is measurable.
My professor, prove this by dividing this in different cases.
By characterization of measurable function with a measurable domain, 
We must show that
$$\forall \alpha \in \mathbb{R}, \{x \in [0,1]: f(x) < \alpha \}$$
He just split this in different cases for alpha around the discontinuity for example
$$\alpha < \lim_{x \to \frac{1}{2}^-}f(x), \lim_{x \to \frac{1}{2}^-}f(x) < \alpha < \lim_{x \to \frac{1}{2}^+}f(x), \alpha > \lim_{x \to \frac{1}{2}^+}f(x)$$.
He assume $f$ increasing. Now Im just wondering, why he does not prove this:
$$\{x \in [0,1]: f(x) < \alpha\} = \{x \in [0,\frac{1}{2}): f(x) < \alpha\}\cup\{x = \frac{1}{2}: f(x) < \alpha\}\cup \{x \in (\frac{1}{2},1]: f(x) < \alpha\}$$ since $f$ is continuous in all of this sets, then it has to be measurable and the finite union of measurable sets is measurable. I'm confusing myself or this is another way ?
 A: Here it is a proof:
Let $a \in \mathbb{R}$.We 'll prove that the set $\{f<a\}=f^{-1}(- \infty,a)$ is measurable.Denote $C=int(\{f<a\})$ which is an open set.
So $\{f<a\}=C \cup (\{f<a\}-C)$
Let $x \in (\{f<a\}-C)$. We have that $x$ is not an interior point of $\{f<a\}$
Then from the  definition of the interior point we must have that  $ \forall \delta>0$ exists $z:|z-x|< \delta$.
such that $z \notin (\{f>a\}-C)$ so $f(z) \geq a$ and also $f(x)<a$ thus $x$ is a point of discontinuity of $f$ so $x=1/2$ and $(\{f>a\}-C)=\{1/2\}$ because $f$ has only one point of discontinuity from hypothesis.
The point $x$ is indeed a point of discontinuity because does not satisfythe necessary condition of this:

$Proposition$ :Let $f: A \rightarrow \mathbb{R}$ and $x_0 \in A$ such that $f$ is continuous at $x_0$.
Then if $f(x_0)<a$ for some $a \in \mathbb{R}$ then exists $\delta>0$ such that $f(x)<a, \forall x \in (x_0- \delta,x_0 + \delta)$

Now we see that $(\{f>a\}-C)$ has measure zero hence its measurable and $C$ as an open set is measurable therefore $\{f>a\}$ is measurable as a union of measurable sets.
A: I don't think you really need to assume $f$ increasing.
To prove that $f$ is measurable, it is enough to prove, that the inverse image of an open interval is measurable. Let's take $I$ to be an open interval.
Now we break $f^{-1}(I)$ into serveral parts:
$f^{-1}(I)=(f^{-1}(I)\cap [0,\frac{1}{2})) \cup \{\frac{1}{2}\} \cup (f^{-1}(I) \cap  (\frac{1}{2},1])$
Now let us prove, that $f^{-1}(I)\cap [0,\frac{1}{2})$ is open: this will prove in particular that it is measurable.
Let $x\in f^{-1}(I) \cap [0,\frac12 )$. $f$ is continuous at x and $I$ is an open neighborhood of $f(x)$ therefore there exists $V$ a neighborhood of x, such that $f(V) \subset I$. By choosing $V$ small enough, we can make sure that $V \subset [0,\frac{1}{2})$ and then $V$ is a neighborhood of $x$ contained in $f^{-1}(I) \cap [0,\frac12 )$, hence $f^{-1}(I) \cap [0,\frac{1}{2})$ is a neighborhood of $x$. This is is therefore a neighborhood of all of its points and is therefore open. We can prove in exactly the same way, that $f^{-1}(I) \cap (\frac12 ,1]$ is open.
As such, $f^{-1}(I)\cap [0,\frac{1}{2})$, $\{\frac12 \}$ and $f^{-1}(I) \cap (\frac12 ,1]$ are measurable, therefore their union is measurable, hence $f^{-1}(I)$ is measurable. Since open intervals generate the Borel sigma algebra over $\mathbb{R}$, we can conclude that $f$ is measurable.
