Let $\Omega \subset \Bbb R^n$ be a convex set and $f: \Omega \to \Bbb R$ be continuous. Show that $f$ is convex if and only if for all $x,y \in \Omega$, $$f\left (\frac{1}{2}x + \frac{1}{2}y \right ) \leq \frac{1}{2} f(x) + \frac{1}{2} f(y)$$ Give a counterexample to the same statement without the assumption that $f$ is continuous.
$\Rightarrow$ is obvious but I am not getting any clue for the other side. I was trying to proceed using the bisection method e.g. for $f(\lambda x+(1-\lambda )y)$ I was trying to approach $\lambda f( x)$ by halving the numbers say $\frac{\lambda x+(1-\lambda )y}{2}$ and same with $(1-\lambda)f( y)$ but it seemed to be not working. Please help me with the proof and the counterexample.