I was solving this problem , to check the measurability of this piecewise continuous function, $$f(x) = \begin{cases} 2, \ \ 0 < x < 1 \\ \pi, \ \ 1 < x < 2 \\ 1.5, \ \ 2 < x < 3 \end{cases}$$
i thought of using the lemma that if $O$ is any open set , then if $f^{-1}(O)$ is measurable then $f$ is measurable but i can't proceed by this way.
Next , i tried sketching the graph of this function and i got it to be asimple function , as it takes finite no. of function values and as simple functions are measurable , $f$ is also measurable.
Is this correct , any other kind of method?