What functions on the plane (and on $\mathbb{R}^n$) have projection-valued derivatives? Thinking about a more general problem I am trying to work out a specific case:
If $U\subset \mathbb{R}^2$ is a connected open set what are the differentiable (or $C^r$) functions $f\colon U\to\mathbb{R}^2$ such that $Df(x,y)$ is a rank one projection for every $(x,y)\in U$?
In other words what are the solutions of the differential equation
$$\begin{cases}
\partial_1f_1+\partial_2f_2=1\\
\partial_1f_2\cdot \partial_2f_1=\partial_1f_1\cdot \partial_2f_2
\end{cases}?$$
I managed to solve three special cases.
Case 1. If the projections have the same range, say it's not the $y$ axis, then assuming $U$ is convex $f$ is of the form
$$f(x,y)=\begin{bmatrix}
g(y-mx)+x\\
m\cdot g(y-mx)+mx+c
\end{bmatrix}$$
for arbitrary $c,m\in\mathbb{R}$ and differentiable function $g\colon\{y-mx\mid(x,y)\in U\}\to\mathbb{R}$. Hence
$$Df(x,y)=\begin{bmatrix}
1-m\cdot g'(y-mx) & g'(y-mx)\\
m-m^2\cdot g'(y-mx) & m\cdot g'(y-mx)
\end{bmatrix}.$$
Case 2. If the projections have the same kernel, say it's not the $x$ axis, then assuming $U$ is convex $f$ is of the form
$$f(x,y)=\begin{bmatrix}
x+my-m\cdot g(x+my)+c\\
g(x+my)
\end{bmatrix}$$
for arbitrary $c,m\in\mathbb{R}$ and differentiable function $g\colon\{x+my\mid(x,y)\in U\}\to\mathbb{R}$. Hence
$$Df(x,y)=\begin{bmatrix}
1-m\cdot g'(x+my) & m-m^2\cdot g'(x+my)\\
g'(x+my) & m\cdot g'(x+my)
\end{bmatrix}.$$
Case 3. If the projections are all orthogonal, in which case $f$ is locally the gradient of some functions $\phi_V\colon U\supset V\to\mathbb{R}$, the only solutions are
$$f(x,y)=\begin{bmatrix}
mx\pm y\sqrt{m(1-m)}+a\\
(1-m)y\pm x\sqrt{m(1-m)}+b
\end{bmatrix}$$
for arbitrary $a,b\in\mathbb{R}$, $m\in[0,1]$. Hence
$$Df(x,y)=\begin{bmatrix}
m & \pm\sqrt{m(1-m)}\\
\pm\sqrt{m(1-m)} & 1-m
\end{bmatrix}.$$
Naturally $f$ maps into a translation of the shared range in Case 1, and is locally constant along the shared kernel in Case 2. But I couldn't find a solution where the two subspaces varied "independently". That is:
Can the function
$$U\to\mathbb{P}^1(\mathbb{R})\times\mathbb{P}^1(\mathbb{R});\quad(x,y)\mapsto(RanDf(x,y),KerDf(x,y))$$
be locally non-constant, and if so what is an example of such a function $f$? I originally asked whether this function can be injective on some open set, but I realize that would be a needlessly strong condition, although I would be interested in an answer to that as well.
Ultimately I have the same questions in arbitrary dimension, but for now I just want to solve this on the plane.
Have these problems been investigated before and where?
 A: Since every point of the image is a critical value (image of a critical point), Sard's theorem implies the image of $f$ has measure zero. It's therefore impossible for $f$ to be injective on an open set, and it looks unlikely that the kernel or range of $Df$ can be non-constant.
Here's a corroborating special case. Suppose $f = (f_{1}, f_{2})$ is smooth, and $Df$ is an orthogonal projection at each point. There exists a smooth, real-valued function $\theta$ in $U$ such that
$$
Df = \left[\begin{array}{@{}cc@{}}
    \cos^{2}\theta & \cos\theta \sin\theta \\
    \cos\theta \sin\theta & \sin^{2}\theta
  \end{array}\right]
= \frac{1}{2}\left[\begin{array}{@{}cc@{}}
    1 & 0 \\
    0 & 1
  \end{array}\right]
+ \frac{1}{2}\left[\begin{array}{@{}rr@{}}
    \cos (2\theta) & \sin(2\theta) \\
    \sin(2\theta) & -\cos(2\theta)
  \end{array}\right].
$$
Consider the function $g(x, y) = f(x, y) - \frac{1}{2}(x, y)$. The components of $g$ satisfy
\begin{align*}
\partial_{1} g_{1} &= \tfrac{1}{2} \cos(2\theta), &
\partial_{2} g_{1} &= \phantom{-}\tfrac{1}{2} \sin(2\theta), \\
\partial_{1} g_{2} &= \tfrac{1}{2} \sin(2\theta), &
\partial_{2} g_{2} &= -\tfrac{1}{2} \cos(2\theta).
\end{align*}
These give
\begin{align*}
-\sin(2\theta)\, \partial_{2}\theta
  &= \partial_{1} \partial_{2}\, g_{1}
   = \cos(2\theta)\, \partial_{1}\theta, \\
 \cos(2\theta)\, \partial_{2}\theta
  &= \partial_{1} \partial_{2}\, g_{2}
   = \sin(2\theta)\, \partial_{1}\theta.
\end{align*}
Multiplying the first by $\partial_{1}\theta$, the second by $\partial_{2}\theta$, and equating gives
$$
\cos(2\theta)\, (\partial_{1}\theta)^{2}
  = -\sin(2\theta)\, \partial_{1}\theta\, \partial_{2}\theta
  = -\cos(2\theta)\, (\partial_{2}\theta)^{2},
$$
or $\cos(2\theta)\bigl((\partial_{1}\theta)^{2} + (\partial_{2}\theta)^{2}\bigr) = 0$. A similar rearrangement shows $\sin(2\theta)\bigl(\partial_{1}\theta)^{2} + (\partial_{2}\theta)^{2}\bigr) = 0$. Consequently,
$$
(\partial_{1}\theta)^{2} + (\partial_{2}\theta)^{2} = 0,
$$
i.e., $\theta$ is constant.
I haven't looked carefully at non-orthogonal projections, but would be a little surprised if similar conclusions couldn't be drawn by similar arguments.
