I just found ashortcut by @Sharkos answer in here : Why does zero derivative imply a function is locally constant?
maybe thats what you looking for. However the standard proof achieved by using mean value theorem.
Let $p,q \in U$. Let $\gamma : [0,1] \rightarrow U$ be a path connecting $p=\gamma(0)$ and $q=\gamma(1)$. We can cover the image $\gamma[0,1]$ by finite number of open balls because $\gamma[0,1]$ compact. I'll leave it to you to show that $f$ is constant on each ball. Because the intersection of these balls is not empty we conclude that $f$ must be the same constant as we move from each ball to the next. After finite steps we conclude that $f(p)=f(q)$. So $f$ is constant on all $U$ $\square$.
$\textbf{EDIT :}$
However, to show that $f$ is constant on each ball use mean value theorem, that is if $\gamma(t) = a + t(b-a)$ is a line segment from $a$ to $b$ on a convex subset $U\subset \mathbb{R}^n$, then there exist $c \in \gamma(t)$ s.t
$$
f(b) -f(a) = Df \cdot (b-a)
$$
By this you must able to show that (by Cauchy-Schwarz ineq.)
$$
\text{if} \quad ||Df|| \leq M \quad \forall x\in U, \text{then} \quad |f(x)-f(y)| \leq M ||x-y|| \quad \forall x,y \in U
$$
and therefore this result you can show that $f$ is constant on the open ball.