TITLE: A question about Cayley-Hamilton's density proof.
QUESTION [6 upvotes]: The usual Cayley-Hamilton proof using density is something like this:

Lemma: Let $f,g:X\to Y$ be two continuous functions in metric spaces $X$ and $Y$. If $f(x)=g(x)$ for all $x\in E$, where $E$ is a dense subset of $X$, then $f=g$.
Let $\chi_A$ be the characteristic polynomial of $A$. Since it is trivial to prove Cayley-Hamilton for diagonalizable matrices and the set of all diagonalizable matrices is dense in $M_n(\mathbb{C})$ we can argue as follows.
  If $A$ is any matrix, there is a sequence of diagonalizable matrices $A_k$ such that $A_k\to A$. Hence, $\chi_{A_k}(A_k)\to\chi_A(A)$ by our lemma. Since $\chi_{A_k}(A_k)=O_n$ (because CH holds for diagonalizable matrices), it follows that $\chi_A(A)=O_n$.

My problem with this proof is the following step: "Hence, $\chi_{A_k}(A_k)\to\chi_A(A)$ by our lemma."
I do not find this obvious. Why is the function $f(A)=\chi_A(A)$ continuous? It is clear that, for a fixed matrix $B$, the function $g(A)=\chi_B(A)$ is continuous as it is a polynomial. However that does not seem to be enough.
Can someone clarify this for me?
Thanks.
EDIT: I further explained my trouble.

Consider the functions $f(A)=\chi_A$ and $g(p)=p(A)$. $f$ maps $A$ to its characteristic polynomial and $g$ gets some polynomial and applies $A$ to it.
  Clearly the map $A\mapsto \chi_A(A)$ is the function $g\circ f$.
$f$ is continuous since $f(A)=\det(xI-A)$. That is, $f$ is polynomial in the entries of $A$.

However, why does $g$ is continuous? How can I prove it?

REPLY [4 votes]: Let $\chi_A^i$ be the coefficient of $x^i$ in $\chi_A$. I believe you agree that each $\chi_A^i$ is a continuous function of $A$.
Then
$$\chi_A(A) = \sum_{i=0}^n \chi_A^i A^i$$
is the sum of products of continuous functions and thus continuous.