24
$\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.

$\endgroup$
0

7 Answers 7

37
$\begingroup$

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.

$\endgroup$
3
  • 3
    $\begingroup$ This is the best answer, since it says exactly which sets appear as zero sets of continuous functions (with an explicit construction). Thus although the OP did not specify what "nontrivial" means -- but it must mean something: e.g. it is probably not very exciting to have a function which is constantly zero on some nontrivial interval -- with this answer in hand it doesn't really matter: one knows the general case. $\endgroup$ Commented May 22, 2011 at 17:49
  • 1
    $\begingroup$ @Pete: By nontrivial, I meant exactly what you said. If a function is constantly zero on some continuous interval of $\mathbb{R}$, of course it has uncountably many roots, but this is not interesting (I thought I had made this clear by stating I was not interested in, eg, $f(x) = 0$ for all $x$). Thanks for the great answer, chandok! $\endgroup$
    – barf
    Commented May 22, 2011 at 21:47
  • 2
    $\begingroup$ I guess the Cantor set would do as an uncountable closed set. $\endgroup$
    – gary
    Commented Jun 30, 2011 at 21:12
10
$\begingroup$

This could be interesting for you.

$\endgroup$
1
  • 1
    $\begingroup$ Andre Henriques's answer has an impressive 86 upvotes! $\endgroup$ Commented May 22, 2011 at 1:56
7
$\begingroup$

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.

$\endgroup$
1
$\begingroup$

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$.

$\endgroup$
1
$\begingroup$

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

$\endgroup$
2
  • 2
    $\begingroup$ I think he is looking for an example that is not 0 on a dense interval, otherwise the problem is pretty boring. $\endgroup$
    – Listing
    Commented May 22, 2011 at 8:49
  • 1
    $\begingroup$ OK, but I only wanted to notice, that he should specify what kind of a "nontrivial" example he is looking for. $\endgroup$
    – t22
    Commented May 22, 2011 at 9:00
1
$\begingroup$

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

$\endgroup$
0
$\begingroup$

If you just want a continuous function, then let $f(x) = 0$ over an interval say $[a,b]$ where $a<b$ 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} $$

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .