Let $f : (0, 1) \to \mathbb{R}$ be defined by $f(x) = 0$ if $x$ is irrational and $f(x) = 1/n$ if $x = \frac{m}{n}$ $m,n \in \mathbb{Z}_{+}$ with $g.c.d(m,n) = 1$.
Then show that a) $f$ is discontinuous at all rational points
b) for any $\epsilon > 0$ the set $E = \{x \in (0,1) : f(x) \geq \epsilon\}$ is finite.
c) Let $E$ be as above. Show that if $a$ is irrational then $inf\{|a -x| : x \in E\} > 0$
d) $f$ is continuous at all irrational points.
I have done parts a and b but couldn’t figure out how to do c and d can anyone provide a proof of these parts please
a) $\forall x \in Q \cap (0,1), \exists \epsilon>0, \forall \delta_\epsilon>0$ such that $|x-x_0|<\delta_\epsilon$ then $|f(x)-f(x_0)|\ge\epsilon$
Let $x=m/n$, then $f(x)=1/n$, $\epsilon = 1/(n-1)$, $x_0 \in (x-\delta,x+\delta) \cap (0,1) \cap R/Q$, $f(x_0)=0$
Then $|f(x)-f(x_0)|=|1/n-0|\ge1/(n-1)=\epsilon$
b) $\forall \epsilon > 0$ the set $E = \{x \in (0,1) : f(x) \geq \epsilon\}$ is finite.
There is a property of the natural number (Peano) such that $\forall \epsilon > 0$, $\exists n \in N$ such that $n \ge 1/\epsilon > n-1$
you just have to notice that for such n we have at most:
0/1, 1/1
0/2, 1/2, 2/2
0/3, 1/3, 2/3, 3/3
...
0/n, 1/n, ..., n/n
(n^2+n-2)/2 numbers, which is finite (some are repeated 1/2 = 2/4)
c) You just have to prove that there is a Cauchy succession such that $\lim_{n\to\infty} x_n-x_{n+m} = 0$ and $\lim_{n\to\infty} x_n = a$
d) For a sufficiently small $\delta$ you can avoid all the rationals whose demoninator is smaller than some n (since the number of rationals with the denominator smaller than same $n \in N$ is finite as proven in b)