[proofplan]
We fix a point $a \in U$ and define the level set $S = \{x \in U : f(x) = f(a)\}$. We show $S$ is simultaneously open and closed in $U$. Openness follows from the [Mean Value Inequality](/theorems/328) applied on small balls (where $M = 0$ gives $f(y) = f(x_0)$). Closedness follows from [continuity](/page/Continuity) of $f$ (a consequence of [differentiability](/page/Derivative)). Since $U$ is connected and $S$ is nonempty, $S = U$.
[/proofplan]
[step:Define the level set and show it is open via the Mean Value Inequality]
Fix $a \in U$ and define $S = \{x \in U : f(x) = f(a)\}$. We have $a \in S$, so $S \neq \varnothing$.
[claim:$S$ is open in $U$]
If $x_0 \in S$, there exists $\delta > 0$ with $B_\delta(x_0) \subseteq S$.
[/claim]
[proof]
Since $U$ is open, choose $\delta > 0$ with $B_\delta(x_0) \subseteq U$. For any $y \in B_\delta(x_0)$, the line segment $[x_0, y]$ lies in $B_\delta(x_0) \subseteq U$ (open balls in $\mathbb{R}^m$ are convex). Since $Df_z = 0$ for all $z \in U$, the hypothesis of the [Mean Value Inequality](/theorems/328) holds with $M = 0$ on $[x_0, y]$:
\begin{align*}
|f(y) - f(x_0)| \leq 0 \cdot |y - x_0| = 0.
\end{align*}
Therefore $f(y) = f(x_0) = f(a)$, so $y \in S$.
[/proof]
[/step]
[step:Show $S$ is closed in $U$ via continuity of $f$]
[claim:$S$ is closed in $U$]
If $(x_k)$ is a [sequence](/page/Sequence) in $S$ with $x_k \to x_\infty \in U$, then $x_\infty \in S$.
[/claim]
[proof]
Since $f$ is [differentiable](/page/Derivative) at $x_\infty$, it is [continuous](/page/Continuity) there by [Differentiability Implies Continuity](/theorems/322). Therefore $f(x_\infty) = \lim_{k \to \infty} f(x_k) = f(a)$, so $x_\infty \in S$.
[/proof]
[/step]
[step:Conclude $S = U$ from connectedness]
The set $S$ is nonempty (since $a \in S$), open in $U$, and closed in $U$. Since $U$ is connected, the only subsets of $U$ that are both open and closed in $U$ are $\varnothing$ and $U$ itself. Therefore $S = U$, meaning $f(x) = f(a)$ for all $x \in U$.
[/step]