Verify if the functions below are convex.
a) $f(x) = \max \{g(x),h(x)\}$ where $h$ and $g$ are convex.
b) $t(x) = \sum_{i=1}^n x_i^2$
c) $s(x) = e^{f(x)}$, $f:\mathbb{R}^n\to\mathbb{R}$
a)
Suppose without loss of generality that $$\max\{g(\lambda x + (1-\lambda)y), h(\lambda x + (1-\lambda)y)\} = g(\lambda x + (1-\lambda)y)$$
then
$$f(\lambda x + (1-\lambda)y) = \max\{g(\lambda x + (1-\lambda)y), h(\lambda x + (1-\lambda)y)\}=\\g(\lambda x + (1-\lambda)y) \le \lambda g(x) + (1-\lambda) g(y) \le \lambda \max\{g(x),h(x)\} + (1-\lambda) \max\{g(y),h(y)\}=\\\lambda f(x) + (1-\lambda) f(y)$$
therefore $f$ is convex
b) $$t(\lambda x + (1-\lambda)y) = \sum_{i=1}^n(\lambda x_i + (1-\lambda) y_i)^2 \le \sum_{i=1}^n\lambda^2x_i^2 + (1-\lambda)^2 y_i^2\le^* \\\sum_{i=1}^n\lambda x_i^2 + (1-\lambda)y_i^2 = \lambda f(x) + (1-\lambda)f(y)$$
- because $\lambda\in[0,1]$ so $\lambda^2 \le \lambda$
so this function is also convex
c) there are no assumptions about $f$ so I'm gonna consider the cases where it is convex and where it is not.
If $f$ is convex:
$$s(\lambda x + (1-\lambda)y) = e^{f(\lambda x + (1-\lambda) y)}\le e^{\lambda f(x) + (1-\lambda)f(y)} = e^{\lambda f(x)}e^{(1-\lambda)f(y)}$$
I don't think it is less than $\lambda e^{f(x)} + (1-\lambda) e^{f(y)}$. So let's try to find an example of convex function such that
$$e^{\lambda f(x)}e^{(1-\lambda)f(y)}> \lambda e^{f(x)} + (1-\lambda) e^{f(y)}$$
for some $\lambda$. If we pick $\lambda=\frac{1}{2}$, $f(x) = |x|$, we must find $y$ such that
$$e^{\frac{1}{2} |x|}e^{\frac{1}{2}|y|}> \frac{1}{2} e^{|x|} + \frac{1}{2} e^{|y|}$$
for some $x$
I don't think there's a solution for this inequality, at least for this $\lambda$. I also tried $f(x)=x^2$ but coulnd't find anything.
For arbitrary $f$ (not necessairly convex), we should search for an inequality
$$e^{f(\lambda x + (1-\lambda) y)}> \lambda e^{f(x)} + (1-\lambda)e^{f(y)}$$
pick $\lambda = \frac{1}{2}$: $$e^{f(\frac{1}{2} x + \frac{1}{2} y)}> \frac{1}{2} e^{f(x)} + \frac{1}{2}e^{f(y)}$$
lets pick $x=0,y=1$ and try to find some $f$ such that
$$e^{f(\frac{1}{2})}> \frac{1}{2} e^{f(0)} + \frac{1}{2}e^{f(1)}$$
I could define a picewise function that would make this not be valid but I'm focusing on continuous $f$. I'm also having a hard time finding a funcion that satisfies this. Maybe the function $e^{f(x)}$ is indeed convex for continuous $f$ but I didn't notice.