The answer upstairs is quite a good hint.by Schur's decomposition,we know every matrix $M\in M_n(C)$ is similar to an upper triangular matrix.we only need to prove that there is a matrix $P$ such that $PAP^{-1}=UPPERTRIANGULAR_1$,$PBP^{-1}=UPPERTRIANGULAR_2$.In other words,they can be transfromed into upper triangular matrix synchronizely.
By the hint upstairs,we know there exists a matrix $P_1$,such that
$P_1AP_1^{-1}$is in the form
$A^{'}=\begin{pmatrix}
\lambda_{1}&*&*&*\\
0 &*&*&*\\
.&.&.&.\\
0&0&0&*
\end{pmatrix}$
$P_1BP_1^{-1}$ in the form
$B^{'}=\begin{pmatrix}
\mu_{1}&*&*&*\\
0 &*&*&*\\
.&.&.&.\\
0&0&0&*
\end{pmatrix}$.
The first column of P is the common eigenvector of $A,B$.(Use the hint upstairs to show the common eigenvector always exists.)
Now notice $A^{'}B^{'}=P_1ABP_1^{-1}=P_1BAP_1^{-1}=B^{'}A^{'}$
We write $A^{'}$ in the form:
$A^{'}=\begin{pmatrix}
\lambda_1&*\\
0&A_1
\end{pmatrix}$
Also we write $B_1$ in the form:
$B^{'}=\begin{pmatrix}
\mu_1&*\\
0&B_1
\end{pmatrix}$
Please show $A^{'}B^{'}=B^{'}A^{'}$ implies $A_1B_1=B_1A_1$
Since the order of your matrices A,B are finite.Do the same procedure on $A_1,B_1$.Actually it has been proved.(Please finish it yourself.)