Could someone help me solve this problem about continuity?

67 Views Asked by At

We say that $f:\mathbb R \rightarrow \mathbb R$ is locally constant if for each $x \in \mathbb R$ there is $\varepsilon_x \gt 0$ such that the restriction of $f$ to the interval $I_x = (x - \varepsilon_x, x + \varepsilon_x)$ is constant. Show that if $f: \mathbb R \rightarrow\mathbb R$ is locally constant and continuous, then $f$ is constant in $\mathbb R$.

3

There are 3 best solutions below

3
On
  • It suffices to show that $f$ restricted to $[-n,n]$ is constant for every $n\in\mathbb{N}$.

  • Fix $n\in\mathbb{N}$. For each $x\in [-n,n]$, pick $\varepsilon_x$ such that $f$ restricted to $(x-\varepsilon_x,x+\varepsilon_x)$ is constant. By compactness, there are $x_1,\dots,x_m\in [-n,n]$ such that $$ [-n,n]\subset \bigcup_{i=1}^m (x_i+\varepsilon_{x_i},x_i+\varepsilon_{x_i}) $$ If $c_i$ is such that $f$ has constant value $c_i$ on $(x_i+\varepsilon_{x_i},x_i+\varepsilon_{x_i})$, then $$ f[[-n,n]]\subset \bigcup_{i=1}^m \{c_i\} $$ Now $f$ is continuous and $[-n,n]$ is connected, so $f[[-n,n]]$ is connected. But then all the $c_i$ are the same.

2
On

If $f$ is not constant then you have a situation like this: There are points $a,b\in\mathbb R$ for which $f(a) = c \ne d = f(b).$ Since $f$ is locally constant there is some $\varepsilon>0$ such that the value of $f$ is $c$ everywhere in the interval $a\pm\varepsilon$ and the value is $b$ everywhere in $b\pm\varepsilon$ (we need not use two different $\varepsilon$s, since if there were two we could just use whichever one of them is smaller).

Suppose $a<b$ and let $e=\sup\{x : \text{the value of $f$ is $c$ throughout the interval } [a,x) \}.$ Since the value of $f$ differs from $c$ in the interval $(b-\varepsilon,b],$ we must have $e\le b-\varepsilon.$

Since $f$ is continuous we must have $f(e)=c.$ But then since $f$ is locally constant, it would have to have the value $c$ on some interval about $e$ that includes numbers bigger than $e,$ and there you have a contradiction.

3
On

Refinement of Michael Hardy's answer:

Locally constant, without needing continuity, already implies globally constant.

Pick any point $z$. By local constant-ness, there exists a nonempty interval $(z-\epsilon,z+\epsilon)$ such that $f(x)$ is constant there, call the value $f(z)=c$.

Suppose there is an upper bound to the contiguous range of values where $f(x)=c$, that is we're looking at $y=\sup_b\{f(x)=c\quad\forall z\leq x<b\}$.

By local constant-ness, there has to exist a nonempty interval $(y-\epsilon',y+\epsilon')$ such that in that interval, $f(x)=f(y)$. There are two cases:

  1. $f(y)=c$: by the definition of the upper bound, when $x>y$, we have that $f(x)\neq c\neq f(y)$, so this contradicts there being an interval of constantness around $y$.

  2. $f(y)\neq c$: similarly we know that when $z\leq x<y$, $f(x)=c\neq f(y)$, again contradicting there being an interval of constantness around $y$.

These combined mean that there cannot be such a supremum $y$, and therefore $f(x)=c$ for all $x>z$. A similar argument says that the interval where $f(x)=c$ is lower-unbounded.

In short, $f$ is globally constant.

PS: Locally constant trivially implies continuity - $\lim_{x\rightarrow z}f(x)$ eventually ends up in the interval of constantness, so clearly the limit exists and equals the function value.