Let $H$ be a monotone function of $f(x)$, a nonnegative measurable function. Write $\int H(f(x)) dx$ in terms of $ g(λ)= |\{f>λ\}|$.
I will show my solution and I have some questions:
1- Do we need more conditions, Like some bounds for $H$ or its integration?
2- I do not know if it is easy or not but I feel I miss some understanding in the moving from steps (1) to (2).
3- The final answer depends on $g$ and $H$ not just on $g$ as required.
My solution
Assume $H$ is increasing. We have $$H(f(x))= \int_0^{f(x)} H'(t) dt.$$
We integrate and use the Tonelli-Fubini we get \begin{align} \int H(f(x)) dx &= \int \int_0^{f(x)} H'(t) dt dx\\ & =\int_0^{f(x)} \int H'(t) dx dt \,\,\,(1)\\ &= \int_0^\infty \int_{\{f>t\}} H'(t) dx dt\,\,\, (2)\\ &= \int_0^\infty H'(t) |\{x:f(x)>t\}| dt\\ &= \int_0^\infty H'(t) g(t) dt \end{align}
I am not sure there is a general solution for the OP's problem, but under some additional assumptions, the statement can indeed be obtained by an application of Fubini's theorem.
The left-hand side of \eqref{fubini1} is os the form stated by the OP where
The Proposition above follows from Fubini's theorem: Since $f$ is measurable, nonnegative, and $\{f>0\}$ is $\mu$ $\sigma$-finite, the set $E=\{(x,t)\in X\times[0,\infty): f(x)>t\}\in\mathscr{M}(\nu\otimes\mu)$ is $\sigma$-finite. By Fubini's theorem \begin{align} \int_{[0,\infty)} \mu(E^t)\,\nu(dt)= \int_{X\times[0,\infty)}\mathbb{1}_E(x,t)\, \mu\otimes\nu(dx, dt) =\int_X\nu(E_x)\,\mu(dx) \end{align}
In the special case where $\nu(dx)=\phi'(x)\,dx$ where $\phi$ is monotone non decreasing absolutely continuous function on $[0,\infty)$ and $\phi(0)=0$, then $$\nu([0,f(x)))=\int^{f(x)}_0\varphi'(t)\,dt=\varphi(f(x))$$ by the fundamental theorem of Calculus. Then, \eqref{fubini1} takes the form $$\int_X\phi\circ f(x)\,\mu(dx)=\int^\infty_0 \mu(\{f>t\})\,\phi'(t)\,dt$$
If $H$ is a monotone nondecreasing left continuous function on $[0,\infty)$ and $\nu_H$ is the Borel measure on $[0,\infty)$ such that $\nu_H([a,b))=\nu(b)-\nu(a)$, then \eqref{fubini1} takes the form $$\int_X H(f(x))-H(0)\,\mu(dx)=\int_{[0,\infty)}\mu(\{f>t\})\,\nu_H(dt)$$