  We consider a $\varphi$-rigidity property for divergence-free vector fields
in the Euclidean $n$-space, where $\varphi(t)$ is a non-negative convex
function vanishing only at $t=0$. We show that this property is always
satisfied in dimension $n=2$, while in higher dimension it requires some
further restriction on $\varphi$. In particular, we exhibit counterexamples to
\textit{quadratic rigidity} (i.e., when $\varphi(t) = ct^2$) in dimension $n\ge
4$. The validity of the quadratic rigidity, which we prove in dimension $n=2$,
implies the existence of the trace of a divergence-measure vector field $\xi$
on a $\mathcal{H}^{1}$-rectifiable set $S$, as soon as its weak normal trace
$[\xi\cdot \nu_S]$ is maximal on $S$. As an application, we deduce that the
graph of an extremal solution to the prescribed mean curvature equation in a
weakly-regular domain becomes vertical near the boundary in a pointwise sense.
