A measurable piecewise function I want to show that the following functions is measurable:
$f:\mathbb{R}\rightarrow \mathbb{R}, f(x) =
  \begin{cases}
   \frac{1}{\sqrt {(1-x^2)}} & ,\text{if } x \in [-1,1] \\
   0       & ,\text{if } x \not\in[-1,1]
  \end{cases}
$
I know the definition of measurable functions, but I can't see a way to apply it for a piecewise function like this. Also, as you can see, this function isn't continuous, so this couldn't be an argument to show the measurability. My teacher said that the above function is a step function so is measurable, but I know that a step function can take just a finite number of values, and this isn't true for $f$. I  don't know another way to show the measurability, so any hint would be appreciated.
 A: *

*Products of measurable functions are measurable. 

*Continuous functions are measurable ($\frac{1}{\sqrt{1-x^2}}:\mathbb{R}\rightarrow\mathbb{C}\cup\{\infty\}$ is continuous).

*Characteristic functions (indicator functions) of measurable sets are measurable.


$[-1,1]$ is a measurable set, and $\frac{1}{\sqrt{1-x^2}}$ and $\chi_{[-1,1]}$ are measurable functions. Thus $$f(x):=\frac{1}{\sqrt{1-x^2}}\cdot\chi_{[-1,1]}$$ is a measurable function.
A: There is a typo in your problem description, since either $f$ maps $\mathbb R \to \overline{\mathbb R}$ or your function definition is incorrect at the boundaries, i.e. $f(1) = f(-1) = 0$. I will assume the second is the case, though it should not make a lot of difference in regards to the argumentation.
In order to show that $f$ is measurable, it is enough to show that for every open set $A \subset \mathbb R$, the following holds: $$f^{-1}(A) \in B(\mathbb R)$$.
So let $A \subset \mathbb R$ be an arbitrary open set. Define the function
$$g: (-1,1) \to \mathbb R, g(x) = \frac{1}{\sqrt{1-x^2}}$$, which is continuous. Note that $0 \notin g((-1,1))$. We distinguish the following two cases:


*

*$0 \notin A$:  Then $f^{-1}(A) = g^{-1}(A)$. Notice that $g$ is continuous, $A$ is open, so that $g^{-1}(A)$ is open in the subspace topology on $(-1,1)$ and thus also in $\mathbb R$ (since $(-1,1)$ is open in $\mathbb R$). Thus $f^{-1}(A) \in B(\mathbb R)$.

*$ 0 \in A$: Then $$f^{-1}(A) = g^{-1}(A) \cup (-\infty, -1] \cup [1, \infty)$$ It follows that $f^{-1}(A)$ is also a Borel set and our proof is ready.
