0

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

  • 1
    Hi, welcome to MSE. The community is usually more receptive if you include your attempts to solve the problem, or what exactly is throwing you off. – Reveillark May 17 '20 at 02:10
  • @CameronWilliams : Your edit seems a bit much, since the dependence of $\varepsilon$ on $x$ is already clear from the quantifiers and there is no indication that the original poster intended to do it that way you did. – Michael Hardy May 17 '20 at 03:02
  • See this answer plus the fact that $\Bbb R$ is connected. – Henno Brandsma May 17 '20 at 09:43

3 Answers3

2

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.

obscurans
  • 3,452
  • Two small points: $(1),,,$ $y=\sup{x\mid f(x)=c}$ without the subscript is enough; the subscript is redundant in this case. $,,(2),,,$ If we imagine some interval on which $f(x) = c$ and also that the function takes different values at some other points on the line, then the set ${x\mid f(x)=c}$ may include other intervals than the one in which $z$ is. That's why I wrote the set in the form in which you see it in my answer. $\qquad$ – Michael Hardy May 17 '20 at 03:09
  • Yeah I noticed this and adjusted it a bit. Not liking the number of letters I'm using... – obscurans May 17 '20 at 03:13
  • +1. Very much like showing that an open real interval is a connected space, or that a closed bounded real interval is compact. BTW in general topology, local continuity is equivalent to continuity. And locally constant (obviously) implies locally continuous. – DanielWainfleet May 17 '20 at 08:02
1
  • 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.

Reveillark
  • 13,699
  • You are using n for two different things: For $[-n,n]$ and for the number of $x_i$'s..... We can also show that if $G$ is a finite family of open intervals with $\cup G\supset [-n,n]$ then there exists $H={h_1,., h_m} \subseteq G$ with $\cup H\supset [-n,n]$ and with $h_i\cap h_{i+1}\ne \emptyset$ whenever $1\le i<m.$ From this we can show that all the $c_i$ are equal, so $f[[-n,n]]={f(0)}$ for any $n,$ without needing to assume continuity of $f.$ – DanielWainfleet May 17 '20 at 07:42
  • The result about $G,H$ in my previous comment, with $[-n,n]$ replaced by any $[a,b], $ with $a<b,$ came up on a totally unrelated Q asking for a rigorous proof that the Lebesgue outer measure of $[a,b]$ is $b-a.$ – DanielWainfleet May 17 '20 at 07:52
  • 1
    @DanielWainfleet Thanks, I really need to stop answering questions late at night – Reveillark May 17 '20 at 16:23
1

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.

  • 1
    I was thinking locally constant already implies constant, without needing continuity, along the same lines. Ignore continuity and let $f(e)\neq c$. Then $x=e$ violates local constant-ness on its own left side. – obscurans May 17 '20 at 02:47
  • @obscurans : I see... I think you're right. $\qquad$ – Michael Hardy May 17 '20 at 03:01