Define $f:\mathbb{R}\rightarrow\mathbb{R}$ by
$\ f(x) = \begin{cases} 1/q & \text{if } x =p/q \space(\mathrm{lowest}\space \mathrm{terms},\space\mathrm{nonzero})\\ 0 & \text{if } x = 0\space\mathrm{or}\space x\not\in\mathbb{Q} \end{cases} $
Show that f is continuous at 0 and every $x\in\mathbb{R}\setminus\mathbb{Q}$. Show that $f$ is not continuous at any nonzero rational pt.
Attempt: (1) First I need to show that $f$ is continuous at zero. Then I need to show that $\forall\epsilon>0,\exists\delta>0$ s.t. $y\in B_{\delta}(0)$ implies $f(y)\in B_{\epsilon}(f(0))$. So I need to show $y\in B_{\delta}(0)$ implies $f(y)\in B_{\epsilon}(0)$ for $y\in\mathbb{R}$. Note $f(0)=0$. Pick $\delta =...$
(2) Then, I need to show that $f$ is continuous at every irrational number. Here I need to show that $\forall\epsilon>0,\exists\delta>0$ s.t. $y\in B_{\delta}(0)$ implies $f(y)\in B_{\epsilon}(f(0))$. Note that once again $f(0)=0$. Pick $\delta = ...$
(3) Then, I need to show that $f$ is not continuous at every nonzero rational number. Let $q\in\mathbb{Q}$. Intuitively, because $\mathbb{I}$ is dense in $\mathbb{R}$, we can construct a sequence $x_n\in\mathbb{I}$ such that $x_n\rightarrow q$. Since $x_n\in\mathbb{I}$, $\lim{x_n}=0\neq f(x)$ so clearly $f(x_n)\not\rightarrow f(x)$.