Dirichlet's Function

Let g(x) be:

g(x)={1xQ0xQ

Pasted image 20241106135111.png

This is discontinuous because for any cR we can construct a sequence of rational numbers (qn)Q where qnc and also (xn)(Q)c where xnc. Notice that:

g(qn)=11,g(xn)=00

These two sequences converge to c but converge to different values, so then the function cannot have a limit at c and thus isn't continuous there.