## Rigidity of functions

Suppose that $u\colon \mathbb R^2\to\mathbb R$ is a continuously differentiable function such that at every point of the plane at least one of the partial derivatives $u_x, u_y$ is zero.

Prove that $u$ depends on just one variable (either $x$ or $y$). In other words, either $u_x\equiv 0$ or $u_y\equiv 0$.