Analysis is one of the first "weird" maths (yes, I'm
British!) topics encountered in a typical course. Until then, it may
be difficult, but rarely counterintuitive. Speaking of
counterintuitive, there will be no sensible order to any of these.
I'll concern myself mainly with real analysis, and leave the details
to the reader. So, here goes!
1.1 Continuous on precisely the irrationals.
If x=p/q
in its lowest terms, let f(x)=1/q, while if x is irrational, f(x)=0.
Let x
n be an
enumeration of the set in question, then f(x
n)=1/n, and otherwise f(x)=0.
1.3 Continuous nowhere.
f(x)=1 if x is
rational, 0 otherwise (the
characteristc function of the rationals).
1.4 Continuous everywhere, differentiable nowhere.
See
Weierstrass
function. Also the
blancmange function, which has the property of
being continuous but nowhere
monotonic. In fact,
it can be shown,
using the
Baire Category Theorem for
ℝ, that "most"
continuous functions are like this.
1.5 Continuous everywhere, differentiable at precisely one point.
Let g(x)=xf(x), where f is defined in the previous point, then g is
differentiable at 0 and nowhere else.
The
Cantor set.
1.6.2 Continuous, differentiable almost everywhere with derivative 0, but increasing, with f(0)=0, f(1)=1.
Cantor function.
1.7 Infinitely differentiable, f(x)=0 if x ≤ 0;, f(x)>0 otherwise.
Define f(x)=e
-1/x if x>0, and 0 otherwise. In particular, f is infinitely
differentiable but not
analytic - it has an
essential singularity
at x=0.
1.8 An integrable function of an integrable
function that is not integrable.
Let f(x)=0 if x=0, and 1 otherwise,
and g(x) be the function defined in 1.1. Then f(g(x)) is the function
defined in 1.3, which is not integrable.
1.9 Two continuous functions f,g from the closed unit interval to itself such that (f(x),
g(x)) is surjective onto the unit square.
Space filling
curve. Of course, the same thing can be done onto the unit n-
dimensional hypercube .
1.10 A uniform limit of differentiable
functions that is nowhere differentiable.
See
Weierstrass function.
1.11 A continuous function that is not of bounded variation, and
hence cannot be written as the sum of two monotonic functions.
f(x)=x sin(1/x) for x non-zero, and zero for x=0.
1.12 A function that takes every real value in every open interval.
Given a real number x, let N(n) denote the number of zeroes in the
decimal expansion of x up to the nth place. Define g(x) to be the
limit as n approaches
infinity of N(n)/n if this limit exists, and zero otherwise. Then g(x) takes every value in the closed unit interval, for x ranging across any arbitrary open interval, since only the first finitely many
digits of x are specified, which doesn't affect the limit. Consequently, if f is a surjection from the closed unit interval to the set of real numbers, then f(g(x)) has the
desired property.
2. Sequences, series, etc.
2.1 A convergent series whose terms, when suitably rearranged, sum
to any desired real number, or even diverge.
Any conditionally convergent series has this
property, for
example the series whose nth term
is (-1)
n/n.
2.2 A sequence for which, for any real number r, there exists a
subsequence which converges to r.
Since the rationals are countable
yet
dense (see
separable metric space), any enumeration of Q has
this property. Thus also, Q is a dense set of
measure 0.