# Not Riemann integrable function which can be Riemann integrable

Consider the function $$f: [0,1] \longrightarrow \mathbb{R}$$

$$f(x)= \begin{cases} \frac{m}{n} &\text{ if } x \in \mathbb{Q}, x = \frac{m}{n}, (m,n) = 1 \\ 0 &\text{ if } x \in \mathbb{R} \setminus \mathbb{Q}\end{cases}$$ where $$(m,n)$$ is the greatest common divisor of $$m,n$$. This function is NOT Riemann Integrable on $$[0,1]$$ but I have a problem with the special case where $$m = 0$$. The author of the question failed to specify that $$m \neq 0$$, though we have $$\gcd(n,m) = 1$$.

• I don't understand the comment about number of partitions. I think what the author wants to say is that $f(x)=1/x$ if $x\in{\mathbb Q}$. Commented Sep 1, 2022 at 2:44
• The only definition we have of $n$, is this: $P_n$ is defined as the partition of $[a,b]$ with $n$ subintervals of equal length. And when $x$ is rational, then indeed $f(x) = m/n$.
– user529632
Commented Sep 1, 2022 at 3:30
• The number of partitions in an integral bound is not at all related to the denominator of $x$. So be sure not to call them both $n$. Commented Sep 1, 2022 at 3:46
• The definition does fail to give a value for $f(0)$. But if it we specify any real value for $f(0)$, the value of one point can't change whether the function is Riemann integrable. Commented Sep 1, 2022 at 3:48
• @aschepler. I can easily prove it is not Riemann integrable. The problem for me is with the integer $m$. If $m = 0$ AND $n = 1$ (which is an option given how the question is asked), then $f(x) = 0$ everywhere on $[0,1]$. I guess I just need to mention this fact.
– user529632
Commented Sep 1, 2022 at 3:56

There is no rational number $$x$$ for which $$x = n/0$$ for some $$n$$, i.e. $$m$$ can never be zero.

You also seem to be assuming that values of $$m$$ and $$n$$ determine the value of $$f$$ on the entire interval. This is not true - differing values of $$x$$ will have differing values of $$m$$ and $$n$$, and those $$m$$ and $$n$$ values only determine the value of $$f$$ at that one, single value of $$x$$.

As to what you say about partitions, I don't really understand it, but again it sounds like you think you can make different choices of $$m$$ and $$n$$, and this will lead to different "versions" of the function $$f$$. This is not the case - $$f$$ is uniquely defined by what is written.

• typo fixed.. $x = m/n$
– user529632
Commented Sep 1, 2022 at 4:19
• Okay, so when $x =0$, $m = 0$ and $n =1$, so $f(0) =0/1=0$. Commented Sep 1, 2022 at 4:23
• Thanks man. this was my error: "You also seem to be assuming that values of 𝑚 m and 𝑛 determine the value of 𝑓 on the entire interval". I got it now.
– user529632
Commented Sep 1, 2022 at 4:26
• The question was so terse. No definitions for n or m, etc... Probably he took it from Rudin.
– user529632
Commented Sep 1, 2022 at 4:27
• Glad to help. Our minds can easily get fixated on a particular interpretation, and we don't even notice it! Commented Sep 1, 2022 at 4:28