# Continuity and Riemann integral of function

I am supposed to determine if function:

$$g(t)=\left\{\begin{matrix} \frac{1}{p+q}, t \in \left ( 0,1 \right )\cap \mathbb{Q}, p,q \in \mathbb{N}, t=\frac{p}{q}, GCD\left ( p,q \right )=1\\ 0, t \in\left ( 0,1 \right )\setminus \mathbb{Q} \end{matrix}\right.$$

1. Is continous in $$t\in \left ( 0,1 \right )\setminus \mathbb{Q}$$
2. Is integrable on $$\left ( 0,1 \right )$$ and if so, determine the value of integral

My solution:

1. $$\left ( \forall \varepsilon> 0 \right )\left ( \exists \sigma > 0 \right )$$ such as interval $$\left ( x_{0}-\sigma , x_{0}+\sigma \right )$$ does not contain any number in the form of $$\frac{1}{p+q}$$, because numbers in those form are finite. So, for $$t\in \left ( x_{0}-\sigma , x_{0}+\sigma \right )$$ is $$g(x)=0$$ and therefore function is continous in $$t \in\left ( 0,1 \right )\setminus \mathbb{Q}$$.
2. $$P(n)=\frac{1}{n}$$, $$L\left (P,g \right )=0$$

Can anyone help me, how to continue, or if my solution is so far correct?

• I'm sorry, but your proof of (1) is completely false. The set of numbers of the form $\frac 1{p+q}$ is infinite. And they are the values of $g(t)$, not of $t$, but your argument claims they restrict $t$. $g(t) = 1/(p+q)$ for any rational value of $t$, and there are rational numbers in every open interval. Thus every neighborhood of a point in $(0,1) \setminus \Bbb Q$ will contain points where $g(t) \ne 0$. To prove this, you need to show that if the interval is small enough, the value of $p+q$ is large (just showing $q$ is large is sufficient). Nov 2, 2019 at 3:47
• As for integrability, the lower sum for any partition is clearly $0$, so you will need to show that the upper sum goes to $0$ as the partition refines. Nov 2, 2019 at 3:59
• @PaulSinclair can you elaborate, how I show that upper sum goes to 0? Nov 2, 2019 at 8:25
• if $\epsilon > 0$, then there is a $q$ such that $1/q < \epsilon$, and there are only finitely many rational numbers in $(0,1)$ whose reduced denominator is $< q$. Each of these can be contained in partition intervals as small as you want. Nov 2, 2019 at 15:55
• @PaulSinclair thank you Nov 2, 2019 at 19:52