Suppose that $x \in {\Bbb R}^n$ and $g: {\Bbb R}^n \to {\Bbb R}$. Under what conditions is $f := g^2$ convex?
It can be seen as the composition $f(x) = h(g(x))$ where $h(y) = y^2$.
From page 83 of Boyd & Vandenberghe's Convex Optimization
f is convex if h is convex, $\tilde{h}$ is nondecreasing, and g is convex,
f is convex if h is convex, $\tilde{h}$ is nonincreasing, and g is concave,
f is concave if h is concave, $\tilde{h}$ is nondecreasing, and g is concave,
f is concave if h is concave, $\tilde{h}$ is nonincreasing, and g is convex.
Here $\tilde{h}$ denotes the extended-value extension of the function h, which assigns the value ∞ (−∞) to points not in domain of h for h convex (concave).
However, in here, $\tilde{h} = h(y) = y^2$ is not nonincreasing or nondecreasing. Is there any general condition about $g$ that makes $f$ convex?