Composition of convex and power function Let $g$ be a convex nonegative function, and $p\ge1$. To show: $f(x)=g(x)^p$ is convex. 
Let $h(x)=x^p$. Then clearly $f=h \circ g$. Denote $\tilde{h}$ as the extended-value extension of $h$, which assigns the value $\infty(-\infty)$ to points not in the domain of $h$ for $h$ convex(concave). Then S. Boyd's convex optimization book tells us:
$f=h \circ g$ is convex if $h$ is convex, $\tilde{h}$ is nondecreasing, and $g$ is convex.
Here is my question: If we define the domain of $h$ as $\mathbb{R}^+$, then $h$ is convex. However, $\tilde{h}$ is not nondecreasing! (Its $\infty$ for $x<0$). So how can we apply the composition property above to prove the convexity of $g(x)^p$?
 A: Since $g$ is non-negative (and $p\geq1$), consider instead the function $h$ defined on $\mathbb{R}$ by
$$\forall x\in\mathbb{R},\ h(x)=\bigl(\max\{0,x\}\bigr)^p$$
With this $h$, we do have:
$$\forall x\in\mathbb{R},\ g(x)^p=(h\circ g)(x),$$
$h$ is convex and we have $\widetilde{h}=h$ is non-decreasing.
A: You can check it directly, let $h:\mathbb{R}_+ \to \mathbb{R}:x \mapsto x^p.$ Since $$h'(x)=px^{p-1}\geq 0 \quad \text{ and } \quad h''(x)=p(p-1)x^{(p-1)(p-2)}\geq 0$$ for every $x \geq 0$, we know that $h$ is non decreasing and convex. For every $x,y \geq 0$ and $t\in [0,1]$ holds $g(tx+(1-t)y) \leq tg(x)+(1-t)g(y)$ by convexity of $g$. Remember that $g$ is supposed to be nonnegative, so
$$g(tx+(1-t)y)^p \leq (tg(x)+(1-t)g(y))^p\leq tg(x)^p+(1-t)g(y)^p$$
where first inequality is due to the fact that $h$ is increasing and the second to the fact that $h$ is convex.
Note: Here we would have $$\tilde{h}= \mathbb{R}_+ \to \mathbb{R}:x \mapsto \left\{\begin{array}{l l}x^p & \text{if } x \geq 0 \\ \infty &\text{else}\end{array}\right. $$ and so $\tilde{h}$  is not nondecreasing because $\tilde{h}(-1)\geq \tilde{h}(0)$. 
