Is it possible to perform a Legendre transform from a Gibbs energy $G(T,p,N_i)$ expression to a state function of the form $\phi(T,H,N_i)$? I want to know whether it is possible to use Legendre transforms to transform a Gibbs energy $G(T,p,N_i)$ expression to a state function of the form $\phi(T,H,N)$. $T$ is the temperature, $p$ is the pressure, $N_i$ is the number of particles of type $i$, and $H$ is the enthalpy. If so, what is $\phi$?
I am unsure since pressure and enthalpy are not the usual conjugate variables seen in textbook thermodynamics.
 A: No.  One of the main properties of the Legendre transform is that when we apply it to a particular argument, the transformed function is a "natural" function of the derivative of the original function with respect to that argument.  For example, in classical mechanics, the derivative of the Lagrangian with respect to a velocity is the momentum;  and the Legendre transform of the Lagrangian is the Hamiltonian, which is a "natural" function of the momentum, not the velocity.
So if you wanted to apply a Legendre transform to a function $f(T, p, N_i)$ to get a "natural" function of $T$, $H$, and $N_i$, it would need to be the case that
$$
\left( \frac{\partial f}{\partial p} \right)_{T, N_i} = H, 
$$
and the Gibbs free energy definitely doesn't satisfy that property.  There's some function $f$ that does (just integrate $H$ with respect to $p$), but it's almost certainly not terribly physically meaningful, and the Gibbs free energy ain't it.
A: As explained in Seifert's answer, it is impossible to obtain your function $\phi$ by Legendre's transform. Quite in general, not all the state functions can be obtained by Legendre's transform. For instance, we may describe a simple system via the internal energy $U$, as a function of entropy ($S$), volume ($V$), and $N$, but also via the function $S(U,V,N)$. In this case too, $S$ and $U$ are not connected by a Legendre transform.
One could try to find a state function of the form you suggest without Legendre transforms. If the desired state function was a function of the form $\phi(T,G,N)$, this is certainly possible.
It is enough to notice that the relation
$$
G=G(T,p,N),
$$
via the implicit function theorem, defines $p$ as a function of $T$, $G$, and $N$. Indeed, the obvious condition
$$
\left.\frac{\partial{G}}{\partial{p}}\right|_{T,N}=V>0
$$
is a sufficient condition for the theorem.
Therefore one can get $p(T,G,N)$ as a function of the state.  In this case, it is more than that. It can be used as a fundamental equation(*) on the same foot as the other thermodynamic potentials or as the entropy and the related Massieu's functions (see Callen's textbook on thermodynamics or Wikipedia page). It is a simple exercise to show that this fundamental equation is maximum at equilibrium.
The case of $p(T,H,N)$ is not that easy. The problem is that
$$
\left.\frac{\partial{H}}{\partial{p}}\right|_{T,N}=
-T\left.\frac{\partial{V}}{\partial{T}}\right|_{p,N}+V.
$$
The first term in the last equality is proportional to the thermal expansion coefficient and it has not a definite sign. Therefore we cannot use the implicit function theorem without additional hypotheses.
With a similar strategy, it would be possible to have a state function (and a fundamental equation) in the form of $p(S,H,N)$.
(*) Fundamental equations (also called characteristic (state) functions) are state functions containing complete information about a thermodynamic system.
