Show that the function $f(\vec{x})=\frac{1}{2}\vec{x}^TG\vec{x}+\vec{x}\vec{c}$ is convex if and only if $G$ is semidefinited positive.
My approach:
$\Rightarrow]$
I want to show that $\vec{x}^TG\vec{x}>0 \quad$ for any $\quad \vec{x}\neq \vec{0}$
Since $f(\vec{x})$ is convex then $f(\vec{x})+\nabla f(\vec{x})(\vec{y}-\vec{x})\leq f(\vec{y})$ for every $\vec{x},\vec{y}\in C$ (domain of $f$)
Then I end up with the following inequality: $$0\leq -\frac{1}{2}\vec{x}^TG\vec{x} + \vec{x}^TG^T\vec{x}+\frac{1}{2}\vec{y}^TG\vec{y}- \vec{x}^TG^T\vec{y}$$
Then $$0\leq \frac{1}{2}(\vec{y}-\vec{x})^TG(\vec{x}+\vec{y})+ \vec{x}^TG^T(\vec{x}-\vec{y})$$
I'm not sure if my approach is correct. Any suggestions would be great!