For any continuous $g:[0,\frac{\pi}{2}]\rightarrow (0,+\infty)$ and $\forall \varepsilon >0$, is there a contiuous $h(t):[0,\frac{\pi}{2}]\rightarrow (0,+\infty)$ such that $$ h(\frac{\pi}{2})\le\left(\frac{2}{\pi}\int_0^{\pi/2}\sqrt{h(t)}dt\right)^2 ~~~ \text{and}~~~ \int_0^{\pi/2}|g(t)-h(t)| dt <\varepsilon ~~~? \tag{1} $$
This problem origin from the answer of this problem, the part of Statement 2 implies Statement 3. Seemly, the author think it is obvious. But I want a detail proof.
What I try: Let $$ h(t)=g(t)*1_{[0,\frac{\pi}{2}-\delta)} + [g(\frac{\pi}{2}-\delta)+k(t-\frac{\pi}{2}+\delta)]*1_{[\frac{\pi}{2}-\delta, \frac{\pi}{2}]} $$ I want to use the first of (1) to get the relation of $k$ and $\delta$, and use $\delta$ to present $k$. Then, in the second of (1), to solve the $k$. But I was stuck in too complex calculation.
In fact, I feel that (1) is not right. But I also don't know how to show it.
The question, pre-edit, was also true, though it took a bit more work. The current problem may be answered simply:
Note that when $0 < \delta < \pi/4$, your $h$ satisfies $$0 < A := \left(\frac2\pi\int_0^{\pi/4}\sqrt{g(t)}\,\mathrm{d}t\right)^2 < \left(\frac2\pi\int_0^{\pi/2}\sqrt{h(t)}\,\mathrm{d}t\right)^2$$
If we set $k = \frac1\delta\left(A - g\left(\frac{\pi}2-\delta\right)\right)$, then $h(\pi/2) = A$ (so $h(\pi/2)$ satisfies the given inequality) and $$\int_0^{\pi/2}|h(t)-g(t)|\,\mathrm{d}t = \int_{\pi/2-\delta}^{\pi/2} |h(t)-g(t)|\,\mathrm{d}t \leq \delta (\max|h| + \max|g|) \leq \delta(A + 2\max|g|)$$ which tends to $0$ as $\delta \to 0^+$.