Question
Let $M$ be a (finite dimensional) smooth manifold and $g,\bar{g}$ be Riemannian metrics on $M$.
Under what conditions can we guarantee that there exists another finite dimensional Riemannian manifold $(N,h)$ and a smooth map $f:M\to N$ such that $(M,\bar{g})$ is realised as the graph of $f$ in the product manifold $(M\times N, g\oplus h)$?
To put it another way, when is it possible to write $\bar{g} = g + f^*h$?
Is there a way to bound the dimension of $N$ required?
Comments
Clearly by definition $\bar{g} - g$ must be positive semidefinite for this to work. But we can equally well ask the question in the context of pseudo-Riemannian manifolds where this requirement is unnecessary.
There is a trivial lower bound on the dimension of $N$ from the fact that the maximal rank of $f^*h$ (equivalently of $\mathrm{d}f$) is bounded above by the dimension of $N$. So if in local coordinates $\bar{g} - g$ is a rank $k$ matrix somewhere, we know that $N$ has to be at least dimension $k$.
The global question aside, what is the correct integrability condition for the local problem? This probably just requires a suitable rephrasing of the question, but I'm having a bit of problem seeing the right geometric picture.
The rank 1 case is not too hard (I think). Without loss of too much generality we can let $N$ be $\mathbb{R}$ with the standard metric. Using that the gradient vector field is orthogonal to the level sets, we have additionally an integrability condition (roughly speaking, let $v$ be the smooth vector field of unit eigenvectors of $\bar{g} - g$ relative to $g$ with non-zero eigenvalue $\lambda^2$, then we need the vector field $\lambda v$ to be hypersurface orthogonal (in the metric $g$); this gives necessity. For sufficiency take a hypersurface orthogonal to $\lambda v$ and set $f = 0$ on there, and integrate along $\lambda v$ to get the desired function).