Let $f(x)=0$ if x is irrational and $f(\frac{p}{q})=\frac{1}{q}$ if $p$ and $q$ are positive integers with no common factors. Show that f is discontinuous at every rational and continuous at every irrational on $(0, \infty)$
If $x$ is irrational, then $f(x^-)=f(x^+)=f(x)=0$. It follows the function is continuous $\forall x \in \mathbb{Q}'$
An addition I did here as the statement right above was not sufficient. Any feedback on that part is much appreciated.
let $x$ be irrational and $a,b \in \mathbb{Z}$ such that $$a+ \frac{1}{b} < x$$ By using the density theorem on the real number there exists an infinite number of rational numbers in between such as: $$a+ \frac{1}{b}< a+ \sum_{1}^{n} \frac{1}{nb}< x$$ As the rational number approaches the irrational number $x$ from the left, $$\lim\limits_{n \rightarrow \infty} f(a+ \sum_{1}^{n} \frac{1}{nb})=\lim\limits_{n \rightarrow \infty} \frac{1}{nb}=0=f(x)$$ We can proceed similarly to the right of $x$ with $x<a-\frac{1}{b}$
As we approach from the left or right of an irrational number, the function $f$ approaches $0$.
Therefore $f$ is continuous at every irrational number.
If $x \in \mathbb{Q}$, we have $x_n= \frac{p}{q}+ \frac{1}{n}$ approaching from the right $x$ such that $$\lim\limits_{n \rightarrow \infty} x_n =x $$ It follows that: $$ \lim\limits_{n \rightarrow \infty} f(x_n) = \lim\limits_{n \rightarrow \infty} \frac{pn+q}{qn}=\frac{p}{q} \neq f(x)=\frac{1}{q} $$ It shows that $f$ is not continuous from the right at any rational point of the domain.
Similarly, given $x$ is rational, and $x_m = x - \frac{1}{n}$ approaching $x$ from the left such that : $$\lim\limits_{n \rightarrow \infty} x_m =x $$
$$\lim\limits_{m \rightarrow \infty} f(x_m) = \lim\limits_{m \rightarrow \infty} \frac{pm-q}{qm}=\frac{p}{q} \neq f(x)=\frac{1}{q} $$
It shows that $f$ is not continuous from the left at any rational point of the domain.
any input is much appreciated.