* Note it’s assumed the reader has a little familiarity with limits for sequences and functions, the connection between limits for sequences and functions (Called Heine’s Continuity Criterion), and continuity for functions. I haven’t decided whether to write a blog post about any of these topics. But it you want that, please comment so and I will be more likely to do so! *
This article was initially written for a friend of mine when we were both taking Real Analysis 1 together. I hope you find it beneficial!
Ok, so you’re familiar with continuity somehow! If you’ve taken only calculus or physics, then you probably have a very intuition-based understanding of continuity, rather than one based on the definition of continuity. However, just as in science, sometimes an intuitive approach to math can lead us astray! A great example of this is the continuity of Thomae’s function (aka the popcorn function or The Stars over Babylon). Before we get to this awesome function, let us ask some questions about functions and their continuity properties: (Everything is in the context of functions of real numbers)
- Can we have a function that is continuous everywhere?
- Is there a function that is discontinuous at only one point?
- Is there a function that is discontinuous at exactly two points?
- Is there a function that is discontinuous at a countably infinite number of points?
- Can a function be continuous nowhere?
- Oooo… can we have a function continuous at irrational numbers and discontinuous at all rational numbers?
I’m guessing your calculus intuition might have helped with the first few questions, but less so towards the end of the list.
Let’s run through some of these questions really quick. We won’t prove our answers here; however, the same logic we will use for Thomae’s function will apply to the more complex questions above.
Can we have a function that is continuous everywhere?
Yes, for example,
Is there a function that is discontinuous at only one point?
Yes, for example, the sign-function. The sign-function is defined to be equal to +1 for positive numbers, -1 for negative numbers, and 0 for .
Is there a function that is discontinuous at exactly two points?
Yes, for example, the rectangular function. Before you click the link, can you guess what the rectangular function might be?
Can a function be continuous nowhere?
This question is where I think calculus/physics intuition starts to fail us (or at least fails for me!). The answer is a surprising… yes! An example is called Dirichlet’s function. It’s a very weird function that is defined as follows,

It’s not a function that lends itself to being graphed; however, there are some attempts out there that you can find. We won’t prove that the Dirichlet function is continuous nowhere; however, you may be able to do so after reading about Thomae’s function!
Oooooo… can we have a function continuous at irrational numbers and discontinuous at all rational numbers?
Yes, yes we can!
Wait! What? We can have a function that is continuous at all irrational numbers and discontinuous at all rational numbers?!? This is where we think: Prove it! And we shall. With Thomae’s function!
Finally, Thomae’s Function
The Definition:
Thomae’s function is defined as follows:

Very strange indeed. Here’s a great visualization of T before we study it.

By Smithers888 – Own work, Public Domain, https://commons.wikimedia.org/w/index.php?curid=4957683
Proof Sketch:
We’ll soon see it’s not too bad to see that T is discontinuous at all It’s trickier to see for that Before we go through the general proof for all irrational numbers, let’s do an example using everyone’s favorite irrational number and for
Let We want to find a such that for all x where we have
Here’s the key idea: Our goal is to get within one-tenth of More precisely, we want First, observe that for all we have so we don’t need to do anything. For this reason, we will focus on that get close to
Consider the set of all rational numbers in the range such that
Some elements in are,
Note that is finite. This is key because it means we can talk about which rational number in gets closest to None will be exact since Through trial and error (or some knowledge about approximating irrational numbers by rational numbers) we conclude:
If we want some rational number to get closer to than does, we need to let the denominator () of the rational number in be larger! For this reason, we claim that letting,
does what we want it to do. Indeed, since for all such that it must be the case that (assume this is ‘s reduced fraction form) where Since if then and by the definition of it must be How awesome!
Thus, Or better yet, Which is what we wanted.
To recap, we showed for letting we have imply
Proof:
We aim to show that is continuous at only irrational numbers We will do this in two steps (i) using Heine’s criterion we show that for any there is a sequence such that as with and (ii) we use the definition of continuity to show for using the same key ideas as in the sketch.
(Step i) for
Let and let be a sequence that converges to such that for all An example of such a sequence is Since and we have By definition of , we conclude for all this implies as However, observe that since Thus, we conclude that is not continuous for any
(Step ii) for
Remember, we’re doing this proof using the definition of continuity.
Let and By the Archimedean property, there is some such that With this in mind, define the set,
We claim letting,
works! The reason is similar to what we remarked earlier. Also, note that since no rational number can equal
Observe, for all such that we either have or In the first case (rational ), there are some such that where and . For these rational it follows . In the other case, we have irrational and thus Thus, for all such that we have,
Concluding the proof!
Closing Remarks
How awesome is Thomae’s function? Answer: It’s pretty darn cool! I hope I made this more palatable for those who are currently taking Real Analysis or who have taken it in the past. I admit this is an advanced blog post; however, I hope that it was interesting!
Any who, you’re probably either sweating from exhaustion for making it to the end (thank you by the way). Or you’re sweating from excitement. In which case you should try to show that Dirichlet’s function is continuous nowhere. If you want a hint read the next line. If not, go have fun!
Oh, one last thing. You can tweak the argument to show that for This would prove that it is continuous at all the irrational numbers and discontinuous at all the rational numbers in one step.
Hint for Dirichlet Function Proof…
Try to come up with a justification why you can make two sequences such that for some but where all elements of are rational numbers and all the elements of are irrational numbers. Then note what equals. It will be different than either or

Leave a Reply