Problem 6 (Jensen's inequality). Let $f: I \longrightarrow \mathbb{R}$ be a concave up function, $I \subset \mathbb{R}$ an interval, and $\lambda_1, \dots, \lambda_n \in (0, \infty)$ positive real numbers with $\sum_{k=1}^n \lambda_k = 1$. Show that for all $x_1, \dots, x_n \in I$,
$$f(\lambda_1x_1 + \dots + \lambda_nx_n) \leq \lambda_1f(x_1) + \dots + \lambda_nf(x_n)\textrm{.}$$
If $f$ is strict concave up then equality in the above can only occur if $x_1 = x_2 = \dots = x_n$.
Hint: induction on $n$. For the induction step $n \to n+1$ set $\lambda := \lambda_1 + \dots + \lambda_n$ and $x := \frac{\lambda_1}{\lambda} x_1 + \dots + \frac{\lambda_n}{\lambda}x_n$.
The base case is easy.
For the inductive step, i take $\lambda$ and $x$ to be as given, and then when I consider
$f(\lambda_1 x_1 + . . . + \lambda_n x_n + \lambda_{n+1} x_{n+1})$
I get this is
$f(\lambda(x) + \lambda_{n+1} x_{n+1})$
I feel like I'm quite close but I don't know where to go from here.