real analysis

A Quasiperiodic Counterexample

The problem Consider a function (f: [0, 1] \to \mathbb{R}) that is continuous with (f(0) = f(1)). It is possible to prove that for each (n \in \mathbb{N}), there exist (x_n, y_n \in [0, 1]) such that (|x_n - y_n| = 1/n) and (f(x_n) = f(y_n)). This means the set of points at which the function is not one-to-one is at least countably infinite. Providing the proof is part of Exercise 4.

A Function Golf Challenge

“Code golf” is the practice of trying to solve a specific problem or implement a specific algorithm in the smallest possible number of characters of a given programming language. A related concept is exploring what can be accomplished with a tweet-length program (for example see here), though “tweet-length” can be a moving target. In the spirit of code golf, I propose the following “function golf” challenge. What is the simplest function (defined on the real numbers) that is continuous everywhere except on a given subset of the reals?