Problem Statement: Suppose $U \subset \mathbb{R}^n$ is open, and $f:U\rightarrow \mathbb{R}$ is a differentiable scalar field such that $\frac{d}{dx}f(x)=0$ for all $x\in U$, show that if $U$ is connected then $f$ is constant. Hint: fix $a \in U$, show that $\left\{x\in U : f(x) = f(a)\right\}$ is clopen.

We had a previous part that I feel might be helpful here. We had to show that if we have a function from an open ball to $\mathbb{R}$, and all directional derivatives are $0$ for all $x$ in the ball, that $f$ is constant. I am confident in that proof, I give it below:

The hypothesis of the mean value theorem is satisfied. We have that $A = B(a) \subseteq \mathbb{R}^n$ is open, we have that $f$ is differentiable on A because all of the directional derivatives exist and equal $0$. We also have that, since the open ball is convex, that $A$ contains a line segment with endpoints $\vec{a}$ and $\vec{a}+\vec{h}$ therefore there is a point $\vec{c}=\vec{a}+t_o \vec{h}$ with $0 < t_0 < 1$ such that $$f(\vec{a}+\vec{h}) - f(\vec{a}) = Df(\vec{c})\cdot \vec{h}$$ however from the problem statement we know that $Df(\vec{c})\cdot \vec{h}$ is zero, therefore $$f(\vec{a}+\vec{h}) - f(\vec{a}) = 0 \implies f(\vec{a} + \vec{h}) = f(\vec{a})$$ This implies that is a constant since the choice of $\vec{a}$ and $\vec{h}$ is arbitrary.

This shows immediately, to me, that the function should be constant because if the derivative is $0$ then all the directional derivatives should be zero and because the set is open, it is the union of open balls. Therefore what I have proven before holds here, but I feel like it shouldn't be that easy. Also I don't see how the hint helps me. If $a$ is the only point in U so that $f(x)=f(a)$ then the set is definitely not clopen, and even if the set is clopen then I have no clue how that helps me. Any help would be appreciated.

  • $\begingroup$ The set described in the hint is clearly closed. To show that it is open, you may use mean value theorem to prove the function is locally constant. $\endgroup$ Sep 29, 2016 at 17:43
  • $\begingroup$ I'm having a bit of trouble showing that. If a is the only point that has f (x)=f (a) then it is not open. I can't really even use the mean value theorem on this because it's only one point. I can show that a neighborhood around a has the function as constant on it, that seems trivial, but that isn't the set the hint gave me so I don't know $\endgroup$
    – Ben Ray
    Sep 29, 2016 at 17:49
  • $\begingroup$ You don't need to make such assumption because as it turns out, that will never happen. Such a neighborhood of any point in the hint's set will be contained in the latter. $\endgroup$ Sep 29, 2016 at 17:57
  • $\begingroup$ Oh, I see because we have that the derivative is 0 so that f(a+h)-f(a) is 0, and so there is a neighborhood around a that has f(x)=f(a) for all x in the neighborhood. $\endgroup$
    – Ben Ray
    Sep 29, 2016 at 17:59
  • $\begingroup$ Yes. Just use that reasoning for every other point of the set. $\endgroup$ Sep 29, 2016 at 18:05

2 Answers 2


Let $S := \{ x \in U :f(x)=f(a)\}$. First, we have $S=f^{-1}(\{f(a)\})$. Since $f$ is differentiable, $f$ is continuous. As $S$ is the inverse image of an closed set ($\{f(a)\}$) by a continuous application, we know that $S$ is closed. Let us show that $S$ is open as well.

Let $x_0 \in S$. Because $x_0 \subset U$ where $U$ is open, there exists $\xi$ such that $D_{\xi} := D(x_0, \xi) \subset U$. Therefore, if $y \in D_{\xi}$ we can write:

$|f(y) - f(x_0)| \leq \max_{x\in[y,x_0]}|Df(x)| |y - x_0| = 0$ which yields $f(y) = f(x_0)$ so that $D_{\xi} \subset S$, proving that $S$ is open as well.

Hence $S$ not being empty and being clopen implies that $S = U$, thus proving that $f$ is constant.

  • $\begingroup$ Okay I see now that the connected assumption is necessary in saying that S=U since in a connected space, the only clopen sets are empty and the universe set. We have shown that S is nonempty and clopen so it has to be the U set. Is there a good counterexample for this where U is not connected, but everything else holds and we have that f is not constant? $\endgroup$
    – Ben Ray
    Sep 29, 2016 at 18:43
  • $\begingroup$ I was thinking that if $U = \left\{(x,y) : xy > 0\right\}$ and we define $f(x,y) = c$ if $x,y > 0$ and $f(x,y) =-c$ if $(x,y) < 0$ which isn't (big question mark here) a constant function, but everything else holds. The function is only locally constant in this case, not globally. $\endgroup$
    – Ben Ray
    Sep 29, 2016 at 18:47
  • $\begingroup$ Let $f(x) = -1$ if $x \in \mathbb{R}^*_-$ and $f(x) = 1$ if $x \in \mathbb{R}^*_+$ is a good counterexample ;). We have $f \in C^{\infty}(\mathbb{R}^*)$ and $Df(x) = 0$ for every $x \neq 0$, but $f$ is not constant. $\endgroup$
    – Hermès
    Sep 29, 2016 at 19:01

Hint: Let $a\in U,$ consider an open ball $B(a,r)\subset U$, for $y\in B(a,r)$, define $f_y:[0,1]\rightarrow R$ by $f_y(t)=f(a+ty)$. Show that $f$ is differentiable and its differential is zero. So you can say that for every $t\in [0,1], f_y(t)=f_y(0)=f(a)=f_y(1)=f(y)$ conclude that $\{y: f(y)=f(a)\}$ is open.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.