How does one prove if a multivariate function is constant?

Suppose we are given a function $f(x_{1}, x_{2})$. Does showing that $\frac{\partial f}{\partial x_{i}} = 0$ for $i = 1, 2$ imply that $f$ is a constant? Does this hold if we have $n$ variables instead?

-
Essentially yes, if the function's domain is both open (so that you can take derivatives to begin with) and connected. If it is not connected, then this is false already for $n=1$. For instance, $f: (0,1) \cup (2,3) \to \mathbb{R}$ defined by $f(x) = 0$ for $x \in (0,1)$ and $f(x)=1$ for $x \in (2,3)$ is nonconstant but its derivative is zero at any point in its domain. –  Mark Oct 2 '11 at 17:29