<s>[INST] Convex Matrix function $f$ Let $g$ be the function the takes the sum of the squares of the elements in a $2\times 2$ matrix. And let $f$ be the function $$f(A) = g(A) + [\det(A)]^2.$$
Is it possible to find 2 matrices $A$ and $B$ such that $f(tA + (1-t)B) > tf(A) + (1-t)f(B)$? In other words, can we show that $f$ is not convex?
 [/INST] Function is not convex! Take $A=\begin{bmatrix}
a & 0\\ 
 0& 0
\end{bmatrix}$ ,and   $B=\begin{bmatrix}
0 & 0\\ 
 0& a
\end{bmatrix}$ we'll show that for large enough $a$, convexity of $f$ fails for these two matrix. Note that $f(A) =f(B) = a^2$
$$f(tA+(1-t)B) = a^2t^2 + a^2 (1-t)^2+a^4t^2(1-t)^2$$ and, therefore for $t=\frac{1}{2}$ we have
$$f(\frac{1}{2}A+\frac{1}{2}B)-\frac{1}{2}f(A)- \frac{1}{2}f(B) = \frac{a^4}{16} - \frac{a^2}{2}$$ so for example for $a=10$ above is positive number which shows $f$ is NOT convex!  
</s>