Here is the question.
Suppose that $f: \mathbb R^n \rightarrow \mathbb R$ has two derivatives and the associated hessian matrix is negative semidefinite on all of $\mathbb R^n$.
Show that for any $x,y\in \mathbb R^n$
$$f(y) \leq f(x)+\nabla f(x)\cdot (y-x) $$
I can show this using Taylor's formula. But the question also says:
If in addition $f(x)\geq 0$ for all $x\in \mathbb R^n$ then show that f must be constant. Can you help me on the second part. I know that I need to show that $\nabla f(x)=0, \forall x\in \mathbb R^n$.