A continuously differentiable function with vanishing determinant is non-injective? (This question relates to my incomplete answer at https://math.stackexchange.com/a/892212/168832.)
Is the following true (for all n)?
"If $f: \mathbb{R}^n \rightarrow \mathbb{R}^n$ is continuously differentiable and satisfies $\det(f'(x)) = 0$ for all $x$, then $f$ is not injective."
If so, what's the most elementary proof you can think of?
It is clearly true for $n=1$. In lieu of a proof for the general case, I'll accept answers for other small $n$.
I have a simple intuitive argument: pick a path in $\mathbb R^n$ such that at each point of the path, it points along some vector in the kernel of $Df$ at that point. (Remember, $\det(f'(x)) = 0$ for all $x$.) Now take the integral of the directional derivative (along the curve) of $f$ over the curve. It describes a difference between two values in the range of $f$, and it should come out to zero (QED). I have a problem showing that such a path exists and is suitable for the purpose described.
Note: "elementary" means stuff that comes before chapter 3 in Spivak's "Calculus on Manifolds". However, note also that Spivak seems to assume that integrals and elementary facts about functions in one variable are available to the reader. Here's a list of things that were not covered in Spivak at the point where the problem came up: constant rank theorem, implicit function theorem. The inverse function theorem was introduced in the same chapter as the problem was given, so that would be ok to use.
Note: This is not quite the initial problem from Spivak, and does not necessarily need to be proved to solve the original problem (see the link).
 A: Very **non**elementary proof:
If $f$ were injective, it would be an open map by invariance of domain. 
But by Sards theorem, the set of critical values (in this case, this is equal to the range of $f$) is a null-set, contradiction. 
EDIT: Note that Sard's theorem is indeed applicable, because $f : \Bbb{R}^n \to \Bbb{R}^n$, see http://en.m.wikipedia.org/wiki/Sard's_theorem
A: One way of proving this is to use relevant parts of the constant rank theorem proof.
(Frankly, I find the constant rank theorem proof a little opaque, but the following observation works for me!)
The proof hinges on the following observation: Suppose the matrix $M$ has rank $r$, and $M$ can be partitioned as 
$M =\begin{bmatrix} A & B \\ C & D \end{bmatrix}$ where $A$ is an invertible $r \times r$ matrix. If we compute
$M' = \begin{bmatrix} I & 0 \\ -C A^{-1} & I \end{bmatrix} M = \begin{bmatrix} A & B \\ 0 & D-C A^{-1} B \end{bmatrix}$, we see that $M'$ must still have rank $r$, and hence we must have $D-C A^{-1} B = 0$.
Suppose $r = \max_x \operatorname{rk} Df(x)$. By hypothesis we have $r < n$. Let $\hat{x}$ be such that $\operatorname{rk} Df(\hat{x}) = r$. In particular, $Df(\hat{x})$ must have a $r \times r$ invertible minor, and hence by continuity, we have $\operatorname{rk} Df(x) = r$ for $x$ in some neighbourhood $U$ of $\hat{x}$.
With appropriate choice of permutation matrices $P_1,P_2$, we can have the upper left $r \times r$ block of $P_1 Df(\hat{x}) P_2$ be invertible.
By considering $\tilde{f}(y) = P_1 f(P_2 y)$ at the point $\hat{y} = P_2^{-1} \hat{x}$, we see that $D \tilde{f} (\hat{y}) = P_1 Df(\hat{x}) P_2$, so to reduce notational clutter, I will just assume that the upper left $r \times r$ block of $f$ is invertible. I will also partition $x=(x_1,x_2)$, where $x_1 \in \mathbb{R}^r$. Similarly, I will write $f=(f_1,f_2)$.
Since the rank is constant in a neighbourhood of $\hat{x}$, the above observation shows that ${\partial f_2 (x) \over \partial x_2 } - {\partial f_2 (x) \over \partial x_1 } {\partial f_1 (x) \over \partial x_1 }^{-1} {\partial f_1 (x) \over \partial x_2 } = 0$ for all $x$ in the neighbourhood $U$.
Now let $b = f(\hat{x})$ and consider the equation $f_1((x_1,x_2)) = b_1$.
The implicit function theorem gives the existence of a locally defined $\lambda$ such that $f_1((\lambda(x_2), x_2)) = b_1$ for $x_2$ in a connected neighbourhood $U_2$ of $\hat{x}_2$. We have ${ \partial \lambda( x_2) \over \partial x_2} = -{\partial f_1 ((\lambda(x_2), x_2)) \over \partial x_1 }^{-1} {\partial f_1 ((\lambda(x_2), x_2)) \over \partial x_2 }$.
Now consider $g(x_2) = f_2((\lambda(x_2), x_2))$, we have
${ \partial g( x_2) \over \partial x_2} = { \partial f_2((\lambda(x_2), x_2)) \over \partial x_1} { \partial \lambda( x_2) \over \partial x_2} + { \partial f_2((\lambda(x_2), x_2)) \over \partial x_2}$. Combining the above two equations gives ${ \partial g( x_2) \over \partial x_2} = 0 $. Hence $g$ is constant in $U_2$, and so we have $f((\lambda(x_2), x_2)) = b$ for $x_2 \in U_2$.
In particular, $f$ is not injective.
