Real Analysis – Testing Riemann Integrability of Function Discontinuous at All Rational Points

continuityepsilon-deltareal-analysisriemann-integration

Prove that the function $f$ from $[a,b]$ to $\mathbb{R}$ defined by
$$f(x) =\begin{cases} \frac{1}{q^2}, & \text{when }x = \frac{p}{q} \\ \frac{1}{q^3}, & \text{when } x=\sqrt{\frac{p}{q}} \end{cases}$$
where $p$ and $q$ are relatively prime integers and $f(x)=0$ for all
other values of $x$, is Riemann integrable on $[a,b]$.

The solution given in my textbook is terse and difficult to comprehend. I somewhat got a rough idea from the book and tried to rewrite a detailed solution myself; however, I couldn't complete it. Please help me finish the solution.

MY SOLUTION

We know that a bounded function $f: [a,b] \to \mathbb{R}$ is R-integrable iff the set of its discontinuity has a measure zero. Therefore, we need to prove that the set of all points of discontinuity in $[a,b]$ is a set of measure zero.

We are going to show that the function $f$ is discontinuous for all rational values of $x$ and continuous for all irrational values of $x$. If the set of discontinuities in the interval is equal to the set of rationals in $[a,b]$, then clearly the set of discontinuities is a set of measure zero. (As any set of rational numbers is a set of measure zero.)

Proving $f$ is discontinuous at all rational points in $[a,b]$

Let $\frac{p}{q}$ be any rational number in $[a,b]$ and $\varepsilon=\frac{1}{(q+1)^2}$

Let $\delta>0$.

Any $x \in (\frac{p}{q}-\delta, \frac{p}{q}+\delta)$ can be both rational and irrational, as every interval, however small, will contain an infinite number of rational and irrational numbers.

Let $x$ be an irrational number in $(\frac{p}{q}-\delta, \frac{p}{q}+\delta)$. Then $x$ can be of the form $\sqrt{\frac{p}{q}}$ or some other irrational value in the interval. Choose a $\delta$ such that there is no irrational of the form $\sqrt{\frac{p}{q}}$ in the interval $(\frac{p}{q}-\delta, \frac{p}{q}+\delta)$. This means that if $x$ is an irrational number in the above interval, then $f(x)=0$.

$\left|f(x)-f(\frac{p}{q})\right| = \left|0-\frac{1}{q^2}\right| = \frac{1}{q^2} > \varepsilon$

$\therefore f$ is discontinuous at $\frac{p}{q}$, i.e. at all rational points in $[a,b]$.

Now we need to prove that $f$ is continuous at all irrational points in $[a,b]$. If we can prove that, it would imply that the set of rational points in $[a,b]$ is the set of all discontinuities in $[a,b]$.

Proving $f$ is continuous at all irrational points in $[a,b]$

Let $y$ be an irrational point in $[a,b]$.
Let $\varepsilon>0$.

It is clear that there will only be a finite number of fractions of the form $\frac{1}{q^2}$ for which $\frac{1}{q^2} > \varepsilon$. Choose a $\delta$ such that the interval $(y-\delta, y+\delta)$ does not contain any rational number $\frac{p}{q}$ for which $\frac{1}{q^2} > \varepsilon$. I.e. choose a $\delta$ such that the interval $(y-\delta, y+\delta)$ contains rational numbers ($\frac{p}{q}$) that satisfies the condition $\frac{1}{q^2} < \varepsilon$ or $q>\frac{1}{\sqrt{\varepsilon}}$.

Now, an irrational number $y$ in $[a,b]$ be of the form $y=\sqrt{\frac{r}{s}}$ or $y \neq \sqrt{\frac{r}{s}}$, where $r$ and $s$ are relatively prime integers. First let's consider $y=\sqrt{\frac{r}{s}}$. We'll prove that the function is continuous at $\sqrt{\frac{r}{s}}$.

$\left|f(x)-f(y)\right| = \begin{cases} \left|\frac{1}{q^2}-\frac{1}{s^3}\right|, \text{if $x$ is any rational point $\frac{p}{q}$ in the interval.}\\ \left|\frac{1}{q^3}-\frac{1}{s^3}\right|, \text{if $x$ is any irrational point $\sqrt{\frac{p}{q}}$ in the interval.} \\ \left|0-\frac{1}{s^3}\right|, \text{if $x$ is any other irrational point in the interval.} \end{cases}$

I'm stuck here. I don't know how to show that $\left|f(x)-f(y)\right|$ is less than $\varepsilon$.

Best Answer

I think your solution is overcomplicated. By Lebesgue theorem, a bounded function $f$ on a segment is Riemann integrable iff the set of the discontinuity points of $f$ has the Lebesgue measure $0$. But I have to note first that there is an ambiguity in the definition of $f(x)$ when $x$ is a positive noninteger rational number. Indeed, then there exist relatively prime integers $p$ and $q>1$ such that $x=\frac pq$, so $f(x)=\frac 1{q^2}$. But the integers $p^2$ and $q^2$ are also relatively prime, and $x=\sqrt{\frac {p^2}{q^2}}$, so $f(x)=\frac 1{q^6}$. But, anyway, for any of these two choices of $f(x)$ for each such $x$, the function $f$ is continuous in all but countable many points of $[a,b]$. Indeed, in any case for each natural $n$ the set $$A_n=\left\{x\in [a,b]:f(x)>\frac 1n\right\}$$ is finite. This easily implies for any $x\in [a,b]\setminus\bigcup_{n\in\mathbb N} A_n$ we have $f(x)=0$, and, moreover, $f$ is continuous at $x$. Indeed, let $n$ be any natural number. Then the set $A_n$ is finite and $x\not\in A_n$. Then $\delta=\min\{y\in A_n:|y-x|\}>0$. Let $x'\in [a,b]$ be any number such that $|x'-x|<\delta$. Then $x'\not\in A_n$, so $0\le f(x')\le \frac 1n$, and $|f(x')-f(x)|\le \frac 1n$.

Related Question