Let $C \subset \mathbb{R}^n$ be a set.
Show the following are equivalent:
(a) The set $C$ is convex.
(b) The function $\delta_C : \mathbb{R}^n \to \mathbb{R} \cup \infty$ defined as: $$\delta_C(x):= 0 \space \space \text{if} \space \space x \in C$$ $$\delta_C(x):= +\infty \space \space \text{if} \space \space x \notin C$$ is a convex function
Attempt:
If $C$ is convex $\exists \space u,v \in C, \lambda \in [0,1]$ such that
$\lambda u + (1-\lambda)v \in C$
And $\exists x,y \notin C, \lambda \in [0,1]$ such that
$\lambda x + (1-\lambda)y \notin C$ $\therefore (a) \implies (b)$
Is this sufficient for the first half of the entire proof? Particularly I was trying to show that the for some $u,v$ implies the top part of the $\delta_C(x)$ whereas the other part implies the bottom equivalence since $+\infty \notin C$
Here is a slightly different, more geometric approach:
A function $f$ is convex iff $\operatorname{epi} f$ is convex.
Note that $\operatorname{epi} \delta_C = C \times [0,\infty)$, and $C \times [0,\infty)$ is convex iff $C$ is convex.