TITLE: Lebesgue integral example
QUESTION [5 upvotes]: please help me with the Lebesgue integration on the function
$$
f(x)=
\begin{cases}
0 & \text{if $x$ < 0}\\
1/2 & \text{if $x$ = 0}\\
1 & \text{if $x$ > 0}
\end{cases}
$$
$$ \\\int_a^b{f}d\mu ? $$
can we take $\mu([a,b))$? 
thank you!

REPLY [10 votes]: I'm not sure what measure you are using, or how you define $\int_a^b f d \mu$ (ie, open, closed or half-open interval). (I am assuming that $\int_a^b f d\mu = \int_{[a,b]} f d \mu$, if not, adjust accordingly below.)
Note that $f$ is a simple function, $f = \frac{1}{2}1_{\{ 0 \}} + 1_{(0,\infty)}$.
Hence
\begin{eqnarray}
\int_{[a,b]} f d \mu &=& \int f 1_{[a,b]}d \mu \\
&=& \int (\frac{1}{2}1_{\{ 0 \}} + 1_{(0,\infty)}) 1_{[a,b]}d \mu \\
&=& \int (\frac{1}{2}1_{\{ 0 \} \cap [a,b]} + 1_{(0,\infty) \cap [a,b]} )d \mu \\
&=& \frac{1}{2}\mu ( \{ 0 \} \cap [a,b]) + 1 \mu( (0,\infty) \cap [a,b])
\end{eqnarray}