---
tag: 91YF82M8AA
kind: counterexample
name: Conway base 13 function
msc: [26A15]
uses: [7BJEH1GCTE, 00KAFBR32E, 0P27W9RW0G]
sources:
  - url: https://en.wikipedia.org/wiki/Conway%27s_base_13_function
same_as:
  wikidata: Q2896394
  wikipedia: Conway's base 13 function
---

## Counterexample

Use base $13$ with the thirteen digits $0, 1, \ldots, 9, \mathtt{+}, \mathtt{-}, \mathtt{.}$, in this order.
For $x \in \R$, take the base-$13$ expansion of the fractional part of $x$ that does not end in an infinite string of the last digit.
Suppose that from some position on, this expansion has the form
$$\mathtt{\pm}\, a_1 a_2 \ldots a_k \,\mathtt{.}\, b_1 b_2 b_3 \ldots$$
This tail consists of a sign symbol and finitely many digits $a_i \in \set{0, \ldots, 9}$.
Then comes the point symbol, and after it only digits $b_j \in \set{0, \ldots, 9}$.
Then set $f(x) = \pm\, a_1 a_2 \ldots a_k . b_1 b_2 b_3 \ldots$, read as an ordinary decimal number.
Otherwise set $f(x) = 0$.

Each open interval $J$ contains all numbers with a fixed integer part whose expansion begins with a suitable finite block of digits.
After that block, any tail can be appended.
So for each real $y$, some $x \in J$ has a tail that encodes $y$, and $f(J) = \R$.

## Remarks

The function $f$ maps every interval onto $\R$, so it is a [[Darboux function|7BJEH1GCTE]]: it has the intermediate value property.
But $f$ is [[continuous|0P27W9RW0G]] at no point, since its values on every interval are unbounded.
So the converse of the [[intermediate value theorem|00KAFBR32E]] fails badly.
Almost every real number has a base-$13$ expansion with infinitely many point symbols, so $f = 0$ [[almost everywhere|RARTMA0ZEC]].

## Explanations

### L1 human

Conway's function hides a decimal number in the end of the base-$13$ digits of $x$.
Every tiny interval contains numbers with every possible ending, so the function takes every real value on every tiny interval.
It never skips a value, yet it is wildly discontinuous everywhere.
So "never skips values" is much weaker than "continuous".
