How to check the function is convex or not? How one can check the function whether it is convex or not. I know one method by using Hessian Matrix but I think it did not fit for the following example.



I think Hessian matrix method cannot be used for this case.
Hint Looking up the definition on Wikipedia, we have that $f$ is convex iff for any $x_1, x_2 \in \Bbb R$ and $t \in [0,1]$:

$$f(tx_1 + (1-t)x_2) \leq tf(x_1) + (1-t)f(x_2)$$

Now, let (for example) $x_1 = -1/2$ and $x_2 = 1/2$. Can you find a $t \in [0,1]$ so that the above does not hold?
Every convex function is continuous.