If $f$ is convex and non-negative and $g$ is concave and positive then $f^{2}/g$ is convex

I came across the following claim and I can't figure out how one should go about proving it:

Let $f:\mathbb{R}^{n}\to\mathbb{R}$ be non-negative and convex on $\text{dom}f\subseteq\mathbb{R}^{n}$ and let $g:\mathbb{R}^{n}\to\mathbb{R}$ be positive and concave on $\text{dom}g\subseteq\mathbb{R}^{n}$. Then $h\left(x\right)=\frac{f^{2}\left(x\right)}{g\left(x\right)}$ defined on $\text{dom}f\cap\text{dom}g$ is convex. I'm not sure what approach to take, computing the Hessian of $h$ seems pretty daunting even before considering that you would need to show it's positive semi-definite. I also tried going by definition of convexity and using the fact that $f^{2}$ is also convex, I managed to get something like: $$h\left(\alpha x+\left(1-\alpha\right)y\right)=\frac{f^{2}\left(\alpha x+\left(1-\alpha\right)y\right)}{g\left(\alpha x+\left(1-\alpha\right)y\right)}\leq\frac{\alpha f^{2}\left(x\right)+\left(1-\alpha\right)f^{2}\left(y\right)}{g\left(\alpha x+\left(1-\alpha\right)y\right)} \leq\frac{\alpha f^{2}\left(x\right)+\left(1-\alpha\right)f^{2}\left(y\right)}{\alpha g\left(x\right)+\left(1-\alpha\right)g\left(y\right)}\leq\frac{\alpha f^{2}\left(x\right)}{\alpha g\left(x\right)}+\frac{\left(1-\alpha\right)f^{2}\left(y\right)}{\left(1-\alpha\right)g\left(y\right)} =\frac{f^{2}\left(x\right)}{g\left(x\right)}+\frac{f^{2}\left(y\right)}{g\left(y\right)}=h\left(x\right)+g\left(y\right)$$ The first inequality in the second row uses the positivity of $g$.

Update: I corrected the assumption, $f,g$ only need to be convex/concave on a domain which isn't necessarily all of $\mathbb{R}^{n}$. This solves the issue about $g$ seemingly needing to be constant.

• You really can't use the Hessian test because, well, you can't assume $f$ and $g$ are differentiable. And frankly the secant definition is almost never worth trying for anything but the simplest functions. – Michael Grant Jan 22 '17 at 21:56

Regarding the difficulties with the condition "$g$ is positive": it's true that no non-constant concave function can be positive on $\mathbb{R}^n$. It can be positive on its domain, but I argue that's not that useful: in an extended-real context, concave functions are defined to be $-\infty$ outside of their domain. However, you really don't need $g$ to be positive; you simply need to define that $f^2/g$ will have the domain $\mathop{\textrm{dom}}(f) \cap \{x\,|\,g(x)>0\}$. (You do, however, need $f$ to be nonnegative, for different reasons.)
Now to the original problem: proving that $f^2/g$ is convex. The easiest thing to do is take this in multiple steps. First, verify that $h(x,y)=x^2/y$, $\mathop{\textrm{dom}} h=\{(x,y)\,|\,y>0\}$ is convex. The Hessian test works well in this case.
Now convince yourself that $h_2(x,y)=\max\{x,0\}^2/y$, with the same domain as $f$, is also convex. For positive $x$, this coincides exactly with $h$; for negative $x$, it is identically zero; and it is continuous at $x=0$.
The reason we take this step is that we now have a function $h_2$ that is convex, non-decreasing in $x$, and non-increasing in $y$. Now we can use composition rules, such as found in Section 3.2 of Boyd & Vandenberghe. In particular, these rules confirm that $h_2(f(x),g(x))$ is convex if $f(x)$ is convex and $g(x)$ is concave.
Finally, note that if $f(x)$ is nonnegative, then $h_2(f(x),g(x))=h(f(x),g(x))$. Hence the original proposition is true.
Technically, we can skip the construction of $h_2$ if we are very careful in the application of the composition rules. The standard rule says that if $h,f$ are convex functions, and $h$ is nondecreasing, then $h(f(x))$ is convex. We can strengthen it to this: if $h,f$ are convex, and $h$ is nondecreasing on the range of $f$, then $h(f(x))$ is convex. With this modified composition rule, we can skip the construction of $h_2$.