How to check if a function is convex
What you gave is the standard definition of a convex function.
If $f$ is supposed to be continuous, it is enough to check that
$$f(\frac{x+y}{2}) \le \frac{f(x)+f(y)}{2}$$ for all $x,y$.
If $f$ is twice differentiable, it is enough to check that the second derivative is non negative.