This is an existence proof and we may not be able to write down the function explicitly.

We need to use the implicit function theorem and consider the function

its Jacobian is equal to its gradient to we get

for all

So by the implicit function theorem such a function must exists.