I discovered this yesterday and I just want to know whether my solution is correct and whether there's a shortcut to it.
Let $g(x)$ be a twice-differentiable continuous function that crosses the points $(0, t)$ and $(1, 1)$ and has stationary points there with $t\in(0,1)$. Then if $$\text{sgn}\left(\int_0^1g(x)g''(x)\,dx\right)-\text{sgn}\left(\int_0^1\frac1{g(x)}\,dx\right)=\pm2$$ for some constant $K\in\mathbb{R}$, $$g(x)=Kg'(x)^2.$$ Furthermore, $g''(x)=\dfrac1{2K}$ when $x\in\mathbb{R}-\{0, 1\}$.
Solution
We use the Cauchy-Schwarz inequality for integrals with $a=0$ and $b=1$: $$\left[\int_0^1\frac{g'(x)}{\sqrt{g(x)}}\,dx\right]^2\le\left(\int_0^1g'(x)^2\,dx\right)\left(\int_0^1\frac1{g(x)}\,dx\right)\tag{1}$$
Firstly, consider the LHS. Let $u=g(x)\implies du=g'(x)\,dx$; thus LHS is $$\left[\int_0^1\frac{g'(x)}{\sqrt{g(x)}}\,dx\right]^2=\left[\int_{g(0)}^{g(1)}\frac1{\sqrt{u}}\,du\right]^2=\left(\left[2\sqrt{u}\right]_t^1\right)^2=4(1-\sqrt t)^2=T>0 \tag{2}$$ as $g(0)=t$ and $g(1)=1$. Now use integration by parts for the first integral on the RHS: $$\int_0^1g'(x)^2\,dx=\left[g(x)g'(x)\right]_0^1-\int_0^1g(x)g''(x)\,dx=-\int_0^1g(x)g''(x)\,dx\tag{3}$$ as $g'(0)=g'(1)=0$. Plugging $(2)$ and $(3)$ into $(1)$, we get $$-T\ge\left(\int_0^1g(x)g''(x)\,dx\right)\left(\int_0^1\frac1{g(x)}\,dx\right)\tag{4}$$ with equality holding if, and only if, $$\dfrac{g'(x)}{\sqrt{g(x)}}=k\implies g(x)=\frac1{k^2}g'(x)^2=Kg'(x)^2$$ where $k,K\in\mathbb{R}$ are constants. Differentiating this, we have $g'(x)=2Kg'(x)g''(x)$.
We can divide by $g'(x)\neq0$ when $x\neq0, 1$ so for $x\in\mathbb{R}-\{0,1\}$, $$g''(x)=\frac1{2K}.$$
Now back to $(4)$. $$\int_0^1g(x)g''(x)\,dx>0\implies\int_0^1\frac1{g(x)}\,dx<0$$ and $$\int_0^1g(x)g''(x)\,dx<0\implies\int_0^1\frac1{g(x)}\,dx>0$$ This means that the sign of $\int_0^1g(x)g''(x)\,dx$ is always opposite that of $\int_0^1\frac1{g(x)}\,dx$. The result follows.