$ f(x)=\begin{cases}\sin x& \text{if $x$ is rational}\\{\cos x} &\text{if $x$ is irrational}\end{cases} $, finding continuous point Problem: Where the following function continuous?$$f(x)=\begin{cases}\sin {x}& \text{$x\in\mathbb Q$}\\ \cos{x} &\text{$x\notin\mathbb Q$}\end{cases} $$
We can predict that $f$ might be continuous at $x={\pi\over4}+k\pi$ where $k\in\mathbb Z$, and otherwise discontinuous. I want to prove this using $\epsilon-\delta$ argument. For example, at $x={\pi\over4}$, for example, it was difficult to express suitable $\delta$ to derive that $|f(x)-{1\over\sqrt2}|\lt\epsilon$.
I learned that it can be proven by using dirichlet $d(x)$, which is $$d(x)=\begin{cases}0&x\in\mathbb Q \\1&x\notin\mathbb Q\end{cases}$$
By setting $f(x):=\sin{x}+d(x)(\cos{x}-\sin{x})$ and $h(x):=\cos{x}-\sin{x}$. We are firstly going to focus on $d(x)h(x)$. 
If $h(a)=0$, then $d(x)h(x)$ is continuous at $a$ since $$\forall\epsilon\gt0, \exists\delta>0 s.t 0\lt|x-a|\lt\delta\implies |d(x)h(x)-d(a)h(a)|=|d(x)h(x)|\le|h(x)|\lt\epsilon$$
Note that $h$ is continuous.
If $h(a)\ne0$, we claim that $d(x)h(x)$ is discontinuous.
Suppose $d(x)h(x)$ is continuous, since $h(x)$ is also continuous, so is $d(x)=\frac{d(x)h(x)}{2}$. However, we can easily prove that $d(x)$ is discontinuous at every point, so it's contradiction" $d(x)h(x)$ is discontinuous.
When $h(x)=0$, $x={\pi\over4}+n\pi$; at such $x$, $f$ is continuous as we proved.
But, I do want to know the solution that does not use without dirichlet function. I tried it, but it was difficult to set up $delta$. Is there an exact way to solve this? 
Thanks very much.
NOTE I have to prove not only continuity at $x={\pi\over4}+k\pi$ but also discontinuity at other points!
NOTE I cannot use limits of sequence in the test, so I really want the solution with epsilon-delta arguements.

Attempt
MVT:
$|\sin x-\sin π/4| \lt |x-π/4|$;
$|\cos x - \cos π/4| \lt |x-π/4|$.
Thus
$|f(x)-1/√2| \lt |x-π/4|$;
Let $\epsilon >0$ be given.
Choose $\delta=\epsilon$.
Then
$|x-π/4| \lt \delta$ implies
$|f(x)-1/√2| \lt |x-π/4| \lt \delta =\epsilon$.
Used:
$\dfrac{f(x)-f(a)}{x-a}=f'(t)$, where $t \in (a,x)$ for $x >a$, and $t \in (x,a)$ for $x <a$.
