My understanding of the Legendre transform is as the following:
If we have a function $f=f(x)$ with $df=pdx$, then we can define the legendre transform $f^*$ of $f$ as:$$f^*(p)=px-f(x).$$ $f^*$ is initially a function of $x$ but we can write it in terms of $p$ instead if $p$ was a monotonous function of $x$.
However, when studying thermodynamic potentials, I found out that we switch variables without making any deal of the monotony part and without being afraid of losing any information, so why is it the case?