Let $f$ be a smooth function defined on the unit disc $D \subset \mathbf{R}^2$ with \begin{equation} f \geq 0 \text{ in $D$ and } f(0) = 0. \end{equation} Note that we do not assume that this is a non-degenerate minimum, namely it is allowed that $D^2 f(0) = 0.$
Question. When is there $\rho \in (0,1)$ and $u \in C^1(D_\rho)$ so that $\lvert D u \rvert^2 = (\partial_x u)^2 + (\partial_y u)^2 = f$? I would be more than happy with an answer specialised to the case where $f$ is the polynomial $(xy)^{2N}$—say with $N \geq 2$—if a general discussion is too onerous.