Let $X$ be a real $n\times n$ matrix with $n\geq 3$ and consider the function $f\colon (\mathbb{R}^{n})^n\to \mathbb{R}$ defined by $f(X)=\det X$ where $\det X$ means the determinant of $X$. If $X$ has rank $n-1$, is $X$ a critical point of $f$? How can the set of critical points of $f$ be defined in terms of the rank of $X$?
I thought this was fairly straightforward (and it still might be) and that I had a solution, but then I realized I wasn't thinking about the derivative of the determinant. A point $X$ is a critical point if $f'(X)=0$ (or is undefined). Since $\text{rk} X=n-1, \det X=0\Rightarrow X$ is not invertible. However, I'm not really sure how to go about considering the derivative of the determinant function. Is there a way to define the determinant so that it's clear what the derivative is? I feel like I'm close to a solution, but I'm not really sure how to handle this part.