Let $A$ be an $n\times n$ matrix. For any polynomials $f,g$, show that $$rank\begin{pmatrix}f(A)\\g(A)\end{pmatrix}=rank\begin{pmatrix}f(A)&g(A)\end{pmatrix}.$$
I just could say $$rank\begin{pmatrix}f(A)\\g(A)\end{pmatrix}=rank\begin{pmatrix}f(A)'&g(A)'\end{pmatrix}.$$ Here $A'$ is the transpose of $A$.
The existence of invertible $P,Q$ such that $PAQ=diag(E_r,0)$ seems to give nothing, since we consider polynomials of $A$.
The Jordan canonical form seem also hit the target. Help.