20
$\begingroup$

This is my first post on SE, forgive any blunders.

I am looking for an example of a function $f:\mathbb{R} \to \mathbb{R}$ which is continuous everywhere but has uncountably many roots ($x$ such that $f(x) = 0$). I am not looking for trivial examples such as $f = 0$ for all $x$. This is not a homework problem. I'd prefer a nudge in the right direction rather than an explicit example.

Thanks!

Edit: Thanks all! I've constructed my example with your help.

7 Answers 7

27

The roots of a continuous function is always a closed subset of $\mathbb{R}$ : $\{0\}$ is closed, thus $f^{-1}(\{0\})$ is closed too.

If you have a closed set $S$, you can define a function $f : x \mapsto d(x,S)$, which is continuous and whose set of roots is exactly $S$ : you can make a continuous function have any closed set as its set of roots.

Therefore you only have to look for closed sets that are uncountable.

  • 2
    I guess the Cantor set would do as an uncountable closed set.2011-06-30
10

This could be interesting for you.

  • 0
    Andre Henriques's answer has an impressive 86 upvotes!2011-05-22
7

Even though you seem to be happy with the given answers, I can't resist pointing out the following construction which I already mentioned in this thread. If this example is already contained in one of the links provided in the other answer, I apologize for the duplication:

Choose a space-filling curve $c: \mathbb{R} \to \mathbb{R}^2$ and compose it with the projection $p$ to one of the coordinate axes. This gives you an example of a continuous and surjective function $f = p \circ c: \mathbb{R} \to \mathbb{R}$ all of whose pre-images are uncountable.

1

If $f(x)$ is the function then $E = \{ x \colon f(x) = 0 \} $ is a closed set. Do you know of a nontrivial, by your standards, closed set with uncountable many points? The complement of $E$ is open. Is there a way to describe the complement of $E$ so that it would be easy to construct the remainder of the function in such a way that the function was never $0$ on the complement of $E$.

1

Why not $f(x)=x+|x|$? Looks quite nontrivial to me.

  • 1
    OK, b$u$t I only wanted to notice, that he should specify what kind of a "nontri$v$ial" example he is looking for.2011-05-22
1

I just thought I'd mention that a Brownian motion has this property (almost surely).

0

If you just want a continuous function, then let $f(x) = 0$ over an interval say $[a,b]$ where $a and over the rest of the real line find functions $g(x)$ and $h(x)$ such that $g(a) = 0$ and $h(b) = 0$ and define $f(x) = g(x), \forall x \leq a$ and $f(x) = h(x), \forall x \geq b$.

You could also have infinitely smooth functions with zero on an uncountable set as for instance $f(x)=\begin{cases}e^{-1/x}&x>0\newline 0&x\leq 0\end{cases}$

And if you want an infinitely smooth function with a compact support

$ f(x) = \begin{cases} \exp(- \frac{1}{1 - x^2}), \quad |x| < 1 \\ 0 , \quad |x| \geq 1 \end{cases} $