A question about a proof of the Cayley-Hamilton theorem using Zariski topology.
"The set $C$ of all matrices of size $n \times n$ (over an algebraically closed field $k$) with distinct eigenvalues is dense in the Zariski topology".
Can we argue as follows?
Since non-empty open sets in the Zariski topology are dense in $k^{n}$ then we are done if we can show the complement of $C$, i.e the set of all matrices of size $n \times n$ with repeated eigenvalues is open in the Zariski topology.
Now to each matrix $B$ of size $n \times n$ compute its characteristic polynomial $p_{B}$ and associate to this polynomial its discriminant $D(p_{B})$. Now define a map:
$f: \mathbb{A}^{n^{2}} \rightarrow \mathbb{A}^{1}$ given by $f(B)=D(p_{B})$ where where $\mathbb{A}^{n}$ denotes the $n$-affine space. I'm identifying here $\mathbb{A}^{n^{2}}$ with the set of all matrices $n \times n$ over an algebraically closed field $k$.
Here is my question. How do we know the map $f$ is continuous with respect the Zariski topology? If we can show it is continuous aren't we done? because we can take $\{0\}$ this is closed in $\mathbb{A}^{1}$ because it is finite, so by continuity of $f$, $f^{-1}(\{0\})$ is closed in $\mathbb{A}^{n^{2}}$ but this preimage is exactly the set of all matrices with repeated eigenvalues.