Let $p:[0,1]\rightarrow\mathbb{R}_{\geq0}$ be a continuous function whose integral over the interval $[0,1]$ equals one. Consider as well the (unknown) continuous and bounded function $M:[0,1]\times\mathbb{R}_{\geq0}\rightarrow\mathbb{R}_{\geq0}$ and the diffeomorphism $g:[x_{1},x_{2}]\subseteq[0,1]\rightarrow[0,1]$, which is considered to be known. My question is: is it possible to determine $M$ which maximizes the expression $\lVert f_{1}(x,M)\rVert_{2}$, where \begin{align*} f_{1}(x,M) = \frac{M(g^{-1}(x),p(g^{-1}(x)))|Dg^{-1}(x)|}{\displaystyle\int_{0}^{1}M(g^{-1}(x),p(g^{-1}(x)))|Dg^{-1}(x)|\mathrm{d}x} \end{align*}
More generally, let $g_{i}:[x_{1},x_{2}]\subset[0,1]\rightarrow[0,1]$ be diffeomorphisms, that are considered to be known, so that we want to maximize the expression $\lVert f_{n}(x,M)\rVert_{2}$, where \begin{align*} f_{n}(x,M) = \displaystyle\prod_{i=1}^{n}\frac{M(g_{i}^{-1}(x),p(g_{i}^{-1}(x)))|Dg_{i}^{-1}(x)|}{\displaystyle\int_{0}^{1}M(g_{i}^{-1}(x),p(g_{i}^{-1}(x)))|Dg_{i}^{-1}(x)|\mathrm{d}x} \end{align*}
In the case that it is not possible, someone could tell me which additional hypothesis are necessary to make it possible to solve this problem? I am looking for a unique solution.
PS: I am a little bit lost as to which domain this problem belongs to. Any help is appreciated.