How would one prove that a linear combination of convex functions is also convex? As above, how would one mathematically prove that a linear combination of convex functions is also convex?
We know a function defined on a convex set $S$ is convex if:
$$f(tx_1+(1-t)x_2)\leq tf(x_1)+(1-t)f(x_2)$$
where $t$ is from $0$ to $1$
We must prove that $\sum_{i=1}^n a_i f_i(x)$ is also convex given a bunch of functions $f_1, f_2$ etc.

How do i approach this problem? I could say the following:
$tf(x_1)+(1-t)f(x_2)+tg(x_1)+(1-t)g(x_2)=t(f(x_1)+g(x_1))+(1-t)(f(x_2)+g(x_2))$
$f(tx_1+(1-t)x_2)+g(tx_1+(1-t)x_2)\leq t(f(x_1)+g(x_1))+(1-t)(f(x_2)+g(x_2))$
Is this how we show it?

Secondly, how would we prove the same thing for a concave function? Isn't it just adding a - sign? How would i mathematically prove it?

hint
You should assume the coefficients positive.
Your sum is finite, so you just need to prove that
$$a_1f_1+a_2f_2$$ is convexe.
$$a_i>0.$$
