Conway's Base 13 Function is a well-known example of a function that satisfies the intermediate-value property, yet is discontinuous at every point in its domain. It is also a function whose provenance is very murky.
Sketch of Construction
The construction is better explained in the Wikipedia article linked above, or in Greg Oman's article on the subject, but I provide a sketch here since some basic discussion is required for the exposition below. The basic idea is to Conway's construction is:
If $f:\mathbb{R}\to\mathbb{R}$ is such that $f(I) = \mathbb{R}$ for any non-degenerate interval $I$ (open or closed), then $f$ will satisfy the intermediate value property trivially, and be discontinuous at every point in its domain.
Conway's idea proceeds by forcing the surjection by examining the decimal expansions of real numbers. Every real number has a decimal expansion, which we can read as a string. In addition to the 10 possible digits (0-9), there are three additional "characters" we need. First we need a "start here" character, which indicates that the (infinite) string to follow should be considered as the decimal expansion of a real number. Next you need a "sign" character, which indicates whether the number is positive or negative. And finally you need a "decimal point" character, which indicates the location of the decimal point.
Thus each real number can be coded as an infinite string that starts with the "start here" character, followed optionally by the "sign" character (if it is negative), and followed by a finite string of the 10 possible digits, followed by a decimal point, and followed by an infinite string of digits.
Conway's construction now starts by expanding the input real number in base 13, generating a string from an alphabet with 13 symbols. We can treat the 11th symbol as the "start here", the 12th symbols as "sign", and the 13th symbol as "decimal point". If the input real number $r$ is such that the base 13 expansion is such that, after truncating finitely many initial symbols, equal to the coding of some real number, then we set that real number to be the output $f(r)$. Otherwise $f(r) = 0$.
History
Conway apparently never published this. In fact, whether Conway should be given credit for this is unclear: the best historical evidence we have is the sleuthing posted at chaoli.club. The author of the article reached out to Adebisi Agboola, who completed his BA in Cambridge. He recalled (quoted from the chaoli.club article):
I arrived at Cambridge University in October 1982 to study for a degree in Mathematics. One of the lecture courses that was taught to first-year students during the first term was Analysis I---this was an introduction to analysis on the real line. The lecturer was Raymond Lickorish, and all first-year students took the course (so there must have been about 200 students in each lecture).
One of the topics covered in the lectures was the Intermediate Value Theorem and its proof, as well as the usual standard counter-example to the converse (namely sin(1/x), etc). After the lecture on this topic, a group of students complained to Lickorish that the counter-example that he had given was rather unsatisfying because it was only discontinuous at a single point. I no longer remember who complained---I was certainly not among them!
At the begining of the next lecture, Lickorish described the complaints of the students, and said that he had discussed the issue with Conway. Conway then showed him the base 13 function (which I don't think that Lickorish had seen before.) I don't know whether Conway had previously constructed the function, or simply produced it response to Lickorish's question. The latter wouldn't surprise me in the slightest---Conway had a most fertile imagination. In any case, Lickorish then described the function to us in the lecture. The name "Conway base 13 function" is, as far as I know, due to Lickorish. (I still have my notes from the course, although I don't have them at hand as I write this.)
At some point here at UCSB, I taught an analysis course in the College of Creative Studies (a college in UCSB that attracts bright undergraduates and gives them a lot of freedom to study certain subjects more deeply than a standard US undergraduate curriculum allows). I described this function when I lectured on the Intermediate Value Theorem. I learned very much later that one of the students had written up a description on Wikipedia.
which provides the provenance of the commonly used name for this function.
But did Conway "invent" this function? Or did he "recall and modify" a construction he has seen before? It is unfortunately too late for us to ask him. Regardless, there seems to have been some "prior art" of excellent vintage.
None other than Henri Lebesgue gave a series of 20 lectures during 1902-1903 at the Collège de France on the (then brand new) notion of the Lebesgue Integral. These lectures are collected and published in 1904 as Leçons sur l’intégration et la recherche des fonctions primitives by Gauthier-Villars (who published almost all notable French math texts in the 19th and early 20th century). A copy of this is available through the Internet Archive; alternatively you can find it on Wikisource. In section 2 of Chapter VI, Lebesgue started by recalling Darboux's theorem that the derivative of a differentiable real function possess the intermediate value property. He then writes:
Il est assez curieux qu’une fonction puisse jouir de cette propriété qui a été prise pour définition de la continuité et être cependant discontinue en tout point.
(Translated: It is rather curious that a function can enjoy this property, which was once taken to be the definition of continuity, and yet be discontinuous at every point.)
He then proceeds to share his construction of a function $\varphi:(0,1)\to [0,1)$ that has the property that $\varphi(I) = [0,1)$ for every non-degenerate subinterval $I$ of $(0,1)$. His construction is as follows, given a number $r\in (0,1)$, write its decimal expansion as
$$ r = 0.a_1 b_1 a_2 b_2 a_3 b_3 \ldots $$
We compute $\varphi(r)$ with the following rules:
- If the string $a_1 a_2 a_3\ldots$ is not periodic, then $\varphi(r) = 0$.
- If the string is periodic, let $n$ be its period. Set $\varphi(r) = 0.b_n b_{n+1} b_{n+2} \ldots$.
It is not too hard to check, in the same way as for Conway's function, that the claimed surjection property holds.
Additional Thoughts
I came across the reference to Lebesgue in Valabrega's "Il teorema di esistenza degli zeri delle funzioni continue nell'analisi moderna." (Atti Accad. Sci. Torino Cl. Sci. Fis. Mat. Natur. 98 1963/1964 437–444), which also reproduced the construction. It seems that in the 1960s at least some folks associated this construction to Lebesgue, and personally I don't think it unlikely that Conway has encountered Lebesgue's writing at some point in his own education. Having encountered Conway frequently as an undergraduate student, I have no doubt that this is the sort of delicious mathematics that Conway would file away and treasure.
Also, for using it in a lecture, I find myself much more drawn toward Lebesgue's version. It is so much easier to define.