Here are some functions that I came over in a question in my mathematics book of chapter continuity. Note that $I$ is the irrational numbers in the following definitions.
$$f(x)=\begin{cases} 1 &&\text{if } x \in \mathbb Q \\ 0 &&\text{if } x \in I\end{cases}$$
$$f(x)=\begin{cases}x &&\text{if } x \in \mathbb Q \\ 1-x &&\text{if } x \in I\end{cases}$$
I wish to know that where the functions are continuous but I am unable to plot them.
What I know:
There are infinitely many irrational numbers between two rational numbers.
There is 1 rational number between two irrational numbers.
I define continuity as follows: say that a function attains value 'b' at input=1 then if we approach a number say 1 from left hand side (I.e. numbers like 0.999999) or right hand side (I.e. numbers like 1.0000001) the function should also approach the value 'b' then we say function is continuous at that point.
How can I determine whether a function define separately on the rationals and irrationals is continuous?