# Distribution of zeroes of a continuous function

I'm interested in the possible distribution of zeroes in a closed interval $[a,b] \subset \mathbb{R}$ of a continuous function $f:\mathbb{R} \rightarrow \mathbb{R}$ that is non-constant in any open interval.

1. I managed to show that if the zeroes are uniformly distributed, then the set of zeroes in $[a,b]$ can be at most finite otherwise they would form a dense set which would imply that the function is constant.
2. I'm curious about the possible number of accumulation points in $[a,b]$. I conjecture that there can be countably many but I haven't managed to construct an explicit example of a function satisfying this requirement.
3. I also believe but I haven't managed to show that there can't be uncountably many accumulation points in $[a,b]$.

Is there a general theorem in analysis or general topology which addresses these particular questions?

Let $C \subset [0,1]$ be a Cantor set (could be the standard middle-thirds one, could be a fat Cantor set), and

$$f(t) = \operatorname{dist}(t,C) = \inf \{ \lvert t-c\rvert : c \in C\}.$$

Then $f\colon [0,1] \to [0,1]$ is a continuous function with $C = f^{-1}(0)$, and $f$ is not constant on any nondegenerate interval. Since Cantor sets are perfect, $f^{-1}(0)$ has uncountably many ($2^{\aleph_0}$) accumulation points.

Every closed subset of a metric space is the zero set of a continuous function, and if the domain is an interval, one can always arrange it so that the function is not constant on any interval not intersecting the zero set. Thus for an interval, every closed subset with empty interior is the zero set of a continuous function that is not constant on any interval.

• What do you mean by $dist(t,C)$? – user93511 Jan 1 '17 at 15:23
• The distance between $t$ and $C$, I've edited to include an explicit expression. – Daniel Fischer Jan 1 '17 at 15:25
• This is a very nice counter-example. – user93511 Jan 1 '17 at 15:27

Part $2$ is solved fast by the function:

$f(x)=\cases{x\sin(1/x)) \text{ if } x\neq 0\\ 0 \text{ if } x=0}$

It has a countable number of zeroes in the interval $[0,1]$.

Sorry, the previous set of discontinuities was countable but had only one accumulation point, the following does the trick:

Take the set $A=\frac{1}{2^n}+\frac{1}{2^m}$ with $n$ and $m$ positive naturals. As in Daniel's answer we can take the function $f(x)=d(x,A)$. The accumulation points are precisely $0$ and $\frac{1}{2^n}$ for positive $n$.

• @JorgeFernándezHidalgo The function must be continuous on $[a,b]$. – user93511 Jan 1 '17 at 15:21
• that function is continuous in all of the real numbers, it just had a "typo" but it was fixed. – Jorge Fernández Hidalgo Jan 1 '17 at 15:22
• He asked not about the number of zeros, but about the number of accumulation points of zeros, which for your example seems to be 1. – Serge Seredenko Jan 1 '17 at 16:57
• @SergeSeredenko Oh yes, thanks for that. – Jorge Fernández Hidalgo Jan 1 '17 at 17:07