# Continuity of sin x over rationals

I need a little help on the following question: For the function $f\colon[0, 2\pi]\to\mathbb R$ defined below, explain with proof, at which points of $c \in [0,2 \pi]$ $f$ is continuous or discontinuous

$$f(x)=\begin{cases} 0 &\text{if x\in\mathbb Q}\\ \sin x&\text{if x\notin\mathbb Q}\end{cases}$$

I've thought that $f$ might be continuous at the points where $\sin x= 0$, i.e., $f(x)$ is continuous at $c = 0, \pi,2\pi$, since any sequence $x_n$ with $\lim_{n\to\infty} x_n=c$, will result in $f(x_n)\to 0$ as $n\to\infty$. $f$ will be discontinuous everywhere else. I'm having trouble in proving this statement. I've been trying to use the epsilon-delta definition to prove discontinuity but in vain. Any help will be appreciated.

Continuity at $0,\pi,2\pi$: Given $\epsilon>0$, the continuity of $\sin x$ gives you a $\delta>0$ such that ... Show that this $\delta$ also works for $f$.
Discontinuity elsewhere: Let $\epsilon=\frac12|\sin x|$ and show that for all $\delta>0$ there are points $y$ near $x$ with $|y-x|<\delta$ and $|f(y)-f(x)|>\epsilon$.
Your suspicion is correct about $f$ being continuous at points $c$ where $\sin(c)= 0$. So suppose $c \neq k\pi$, which means $\sin(c) \neq 0$. Now let $(x_n)$ be a sequence that converge to $c \notin \mathbb{Q}$ with the caveat that $x_n \in \mathbb{Q}$ for all $n \in \mathbb{N}$. Then $\sin(x_n) = 0$ and $$\left|\sin(x_n)-\sin(c)\right| = \left|\sin(c)\right|$$ So for any $\varepsilon>0$ where $\varepsilon <\left|\sin(c)\right|$ we cannot find an $N\in \mathbb{N}$ such that $\left|\sin(x_n)-\sin(c)\right|< \varepsilon$ for all $n\geq N$. Since we have found a sequence $x_n \to c$ but $f(x_n) \not\to f(c)$, then $f$ is not continuous at $c$.