Given a function $f : \mathbb{R}^{n} \to \mathbb{R}$, its epigraph is defined as follows
$$ \operatorname{epi} f = \left\{ (x,t) \in \mathbb{R}^{n+1}: x \in \mathbb{R}^{n}, t \geq f(x) \right\} $$
Could someone please help me prove that a function is convex iff its epigraph is a convex set?
Put $\Gamma = \text{epi}(f)$. Suppose first that $f$ is convex, and let $(x_1, t_1), \dots, (x_n, t_n)\in \Gamma$. For any $\lambda_1, \dots, \lambda_n\in [0, 1]$ with $\sum \lambda_i = 1$, the point $(x, t) = \lambda_i \sum (x_i, t_i) = (\sum \lambda_i x_i, \sum \lambda_i t_i)$ has $$t = \sum \lambda_i t_i \geq \sum \lambda_i f(x_i) \geq f\left(\sum \lambda_i x_i\right) = f(x).$$ Hence $(x, t)\in \Gamma$, and $\Gamma$ is convex. The converse is entirely similar.