Let $x = \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix} \in \mathbb{R}^n$
Let $f: \mathbb{R}^n \to \mathbb{R}^{n \times n} \quad f(x) = xx^T$ be its outer product
How to assess convexity of $f(x)$?
In other words, is $f(x) = xx^T$ convex on $\mathbb{R}^n$, if not, is it convex on $\mathbb{R}^n_{\geq 0}$...
Let us say that $f:\mathbb{R}^n\rightarrow M_n$ is convex if $(1-a)f(x)+af(y)-f((1-a)x+ay)$ is a positive semidefinite hermitian matrix for every $x,y\in \mathbb{R}^n$ and $0\leq a \leq1$.
Let us prove that $f(x)=xx^t$ is convex.
Notice that $(1-a)f(x)+af(y)-f((1-a)x+ay)=(x,y)A(x,y)^t$, where $A=\pmatrix{1-a & 0 \\ 0 & a}-\pmatrix{(1-a)^2 & (1-a)a \\ (1-a)a & a^2}$.
Consider $\frac{A}{(1-a)a}=\pmatrix{\frac{1}{a} & 0 \\ 0 & \frac{1}{1-a}}-\pmatrix{\frac{1-a}{a} & 1 \\ 1 & \frac{a}{1-a}}=\pmatrix{1 & -1 \\ -1 & 1}$.
Thus, $(1-a)f(x)+af(y)-f((1-a)x+ay)=(x,y)A(x,y)^t=$
$(1-a)a(x,y)\pmatrix{1 & -1 \\ -1 & 1}(x,y)^t$,
which is positive semidefinite, whenever $0\leq a\leq 1$.