A real-valued continuous function on a convex set $C$ in $\mathbb{R}^{n}$ is convex if it is convex on the relative interior of $C$. I am self-studying a book named "Geometric methods and Optimization problems" by V. Boltyanski, and this problem is an exercise in page 14 of that book. 
Let $f$ be a real valued continuous function on a convex set $E\subset \mathbb{R}^n$ which is convex on the relative interior of $E$. Then the function is convex on $E$, too.
I think we can replace the phrase "relative interior" by just "interior" and assume moreover that $C$ has nonempty interior to prove the above assertion. (Since we can always restrict the whole space to the affine hull of $C$.)
Any help will be appreciated.

Hint: pick any $x, y \in C$ and choose sequences $x_n, y_n \in \operatorname{ri} C$. such that $x_n \to x$ and $y_n \to y$. If $\lambda \in [0, 1]$, then,
$$\lambda f(x_n) + (1 - \lambda)f(y_n) - f(\lambda x_n + (1 - \lambda)y_n) \ge 0$$
for all $n$.
