So as far as I know to be riemann integrable there should be an value (lets say e>0 ) that $U(f,P)-L(f,P) < e$. However my teacher showed that below function is not riemann integrable by this method.
Method
$$f(x) = \begin{cases} 1 & x\in[0,1]\cap \Bbb Q , \\ 0 & otherwise .\end{cases}$$
What she did was, $U(f,P) = 1(1-0)$ and $L(f,P) = 0(1-0)$ Since both are not equal this is not riemann integrable.
Problem
What she did was clear to me. So I tried to prove this beliw one using the same logic. But I don't know how to start it. If someone can please tell me what should I do to prove whether this is reimann integrable or not.
Let,
$$f(x) = \begin{cases} 1 & x\in[0,1]\setminus\ \frac{1}{2}\, \\ 0 & x=\frac{1}{2} .\end{cases}$$
Let $P$ be a partition and let $a$ be the length of the sub-intervals which includes $1/2$.
Note that: if $1/2$ is an end point, then there exist two such sub-intervals and if it is not, then there exists one sub-interval.
Since each sub-interval has image value $1$, we have the supremum on each interval is $1$. Therefore $$U(f,P)=1.$$ Since the length of interval having the $1/2$ is $a$, we have $$L(f,P)=1-a.$$
Now $$U(f)=1$$ and $$L(f)=\sup\{ 1-a \; | \; a \in (0,1]\}=1.$$ Therefore, it is Riemann integrable and the integral value is $1$.