Here $n$ is any integer. This is my attempt at solving the question:
Since $n \pi+\frac{\pi}{4}$ is irational, $f(x)=\cos(x)$. Let $h$ be a infinitesimally small positive quantity and $n=1$ $$ RHL=\lim\limits_{h\rightarrow0}f\left(\frac{\pi}{4}+h\right)$$ $$LHL=\lim\limits_{h\rightarrow0}f\left(\frac{\pi}{4}-h\right)$$
This is where my confusion begins, if we assume $h$ to be an infinitesimally small irrational number in the first case and infinitesimally small rational number in the second case then the function will be discontinuous.
If we assume $h$ to be an infinitesimally small rational number in the first case and infinitesimally small rational number in the second case then the function will be continuous.
However If we assume $h$ to be an infinitesimally small irrational number in the first case and infinitesimally small irrational number in the second case then the function will be discontinuous. So how can a function like this exist, and where am I going wrong?
Since the point $n\pi+(\pi/4)$ under consideration, say $a$, is irrational we have $f(a) =\cos a$ and thus $$|f(x) - f(a) |=|\sin x - \cos a|=|\sin x - \sin a|$$ as $\cos a =\sin a$ when $x$ is rational and $$|f(x) - f(a) |=|\cos x-\cos a|$$ if $x$ is irrational.
Now observe that both the differences $|\sin x-\sin a|$ and $|\cos x - \cos a|$ never exceed $|x-a|$. Why??
Well, $$|\sin x - \sin a|=|2\cos((x+a)/2)\sin((x-a)/2)|\leq 2|(x-a)/2|=|x-a|$$ and similarly one can handle the other difference.
Hence $$0\leq |f(x) - f(a) |\leq |x-a|$$ If you are aware of definition of limit then the above inequality allows you to take $\delta =\epsilon $ and show that $\lim_{x\to a} f(x) =f(a) $.
On the other hand if you are not aware of definition of limit you can use Squeeze theorem to conclude $\lim_{x\to a} f(x) =f(a) $. And therefore the function is continuous at all points $a$ of the form $a=n\pi+(\pi/4)$.