Show that the derivatives of a $C^1$ function vanish a.e. on the inverse image of a null set Let $A \subset \mathbb{R}$ be such that $\lambda(A) = 0$, where $\lambda$ is the Lebesgue measure on the real line.
Let $\Omega \subset \mathbb{R}^N$ be an open set and let $u \colon \Omega \to \mathbb{R}$ be in $C^1(\Omega)$. Then, for every $i = 1, \dots , N$, we have that $$\frac{\partial u}{\partial x_i}(x) = 0$$ for $\lambda^N$-almost every $x \in u^{-1}(A)$. (where $\lambda^N$ is of course the lebesgue measure on $\mathbb{R}^N$)
Does anyone know a proof of this fact?
The lecture notes continue saying that since every singleton has Lebesgue measure $0$ in $\mathbb{R}$, we have that $$\frac{\partial u}{\partial x_i}(x) = 0$$ for $\lambda^N$-a.e. $x \in \Omega_c$, where $\Omega_c := \{x \in \Omega : u(x) = c\}$.
 A: The statement is true, below is a proof. You will see from the proof that it works under the assumption weaker than $C^1$, namely, it suffices to assume that $f$ is absolutely continuous on almost every line parallel to a coordinate axis. 
I will first give a proof in the 1-dimensional case and then use it to proof the general claim. I will use the notation $|Z|$ to denote the (1-dimensional) Lebesgue measure of subsets $Z\subset {\mathbb R}$. I will also denote by $B_r(z)\subset {\mathbb R}$ the closed ball of radius $r$ centered at $z\in {\mathbb R}$. If $z=0$, set $B_r=[-r,r]$. 
We will need  
Theorem (Lebesgue density theorem). Let $Z\subset {\mathbb R}$ be a (measurable) subset of positive measure. Then almost every point $z\in Z$ is a density point,  i.e.,
$$
\lim_{r\to 0} \frac{|B_r(z)\setminus Z|}{|B_r(z)|}=0. 
$$
Let $A\subset {\mathbb R}$ be a measure zero subset. For a $C^1$-smooth function $f: {\mathbb R}^n\to {\mathbb R}$ set
$$
E=f^{-1}(A), E'= E\cap \{x: df(x)\ne 0\}. 
$$
Note that both $E$ and $E'$ are measurable sets. 
Lemma. Let $f: {\mathbb R}\to {\mathbb R}$ is a $C^1$-function. Then $E'$ has zero measure. 
Proof. Suppose not. Then there exists a density point $z\in E'$. By making affine change of variables in domain and range, we can assume  that $z=0$ and $f'(0)=1$. By continuity of $f'$, there exists $r_0>0$ such that for all $x\in B_{r_0}$,
$$
\frac{1}{2} < f'(x)< 2. 
$$
In particular, for every $r\in (0, r_0)$ and every measurable subset $S\subset B_r$,
$$
|f(S)|\le 2|S|
$$
(here is the only place where the assumption that the domain of $f$ is 1-dimensional is needed). Set
$$
E_r'= B_r\cap E', E_r''= B_r \setminus E'.
$$
Since $f(E_r')\subset A$, and $|A|=0$, we get $|f(E_r')|=0$. On the other hand, since $0$ is a density point of $E'$, for every $\epsilon>0$ there exists $0<r_1<r_0$ so that for all $r\in (0, r_1)$
$$
|E_r''|< \epsilon |B_r|. 
$$
Thus,
$$
|f(E_r'')|\le 2\epsilon |B_r|. 
$$
By compining this with the fact that $|f(E_r')|=0$, we see that, for $r<r_1$, 
$$
|f(B_r)| \le 2\epsilon |B_r|.  
$$
On the other hand, by the mean value theorem (taking into account that $0.5\le f'(x)<2$ for $x\in B_{r}$, 
$$
|f(x)-f(0)|\ge \frac{1}{2}|x|
$$
for all $x\in B_r$. In particular, $|f(B_r)|\ge |B_r|/2$ for all sufficiently small $r>0$. Thus, we obtain:
$$
\frac{1}{2}|B_r|\le |f(B_r)|\le 2\epsilon|B_r|
$$ 
for all $r\in (0,r_1)$. Taking $\epsilon=1/8$ we obtain a contradiction. qed 
Now, we can prove the claim for general $n$. 
Theorem.  Let $u: {\mathbb R}^n\to {\mathbb R}$ is a $C^1$-function. Then the set 
$$
E'=u^{-1}(A)\cap \{p: du(p)\ne 0\},
$$ 
has zero measure. 
Proof. It suffices to show that for each $i=1,...,n$, the set
$$
E_i'=E\cap \{p\in {\mathbb R}^n: \frac{\partial}{\partial x_i} u(p)\ne 0\}
$$
has zero measure. By renumbering the cooridnates, it suffices to check this for $i=n$. For every $y\in {\mathbb R}^{n-1}$ consider the 
line $L_y=\{(y,x): x\in {\mathbb R}\}$ in ${\mathbb R}^n$. Restriction of $f$ to $L_y$ is $C^1$-smooth. Therefore, by Lemma, for each $y$, the set
$$
E_y'= E\cap \{\frac{\partial}{\partial x} f (y,x)\ne 0\}
$$ 
has zero measure 1-dimensional. Therefore, by Fubini's theorem, the set
$$
E_n'= \bigcup_{y\in {\mathbb R}^{n-1}} E_y'
$$
has zero $n$-dimensional measure. qed 
A: I'm sorry. This continues to be just plain wrong. Try $u(x) = x_1^2+x_2^2$. The only place both partial derivatives vanish is at the origin. So, for any $c\in\Bbb R-\{0\}$, the gradient of $u$ vanishes at no point of $u^{-1}(\{c\})$.
What Sard's Theorem tells us (at least, if $u\in C^N(\Omega)$) is that almost every $c\in\Bbb R$ is a regular value; that is, for almost all $c$, for every $x\in u^{-1}(\{c\})$ some partial derivative of $u$ is nonzero at $x$.
The other issue I have with your edited version is that for almost all $c\in\Bbb R$ it is the case that $\lambda^N(\Omega_c)=0$. That is, we expect $\Omega_c$ to be a smooth hypersurface, which necessarily has measure zero in $\Omega$.
