We prove that $A$ and $B$ have the same characteristic polynomial. Then the result follows immediately since eigenvalues and algebraic multiplicities of a matrix are determined by its characteristic polynomial.

Since $A$ and $B$ are similar, there exists an invertible matrix $S$ such that $S^{-1}AS=B$.
Let $p_A(t)$ and $p_B(t)$ denote the characteristic polynomials of $A$ and $B$, respectively.

We have
\begin{align*}
p_B(t) &= \det(B-tI) =\det(S^{-1}AS-tI) \\
&=\det(S^{-1}(A-tI)S) = \det(S^{-1}) \det(A-tI) \det(S) \\
&\stackrel{(*)}{=}\det(A-tI)=p_A(t).
\end{align*}

Here the fifth equality (*) follows from the fact that $\det(S^{-1})=\det(S)^{-1}$.
(Also note that even though matrix multiplication is not commutative in general but determinants are just numbers, thus we can change the order of the product of determinants.)

Thus we showed that $p_A(t)=p_B(t)$ and this completes the proof.

Related Facts

We proved that if $A$ and $B$ are similar, then their characteristic polynomials are the same.

Since the determinants and the traces are the coefficients of the characteristic polynomials.
Thus, if $A$ and $B$ are similar, their determinants and traces are the same.

A Matrix Similar to a Diagonalizable Matrix is Also Diagonalizable
Let $A, B$ be matrices. Show that if $A$ is diagonalizable and if $B$ is similar to $A$, then $B$ is diagonalizable.
Definitions/Hint.
Recall the relevant definitions.
Two matrices $A$ and $B$ are similar if there exists a nonsingular (invertible) matrix $S$ such […]

Maximize the Dimension of the Null Space of $A-aI$
Let
\[ A=\begin{bmatrix}
5 & 2 & -1 \\
2 &2 &2 \\
-1 & 2 & 5
\end{bmatrix}.\]
Pick your favorite number $a$. Find the dimension of the null space of the matrix $A-aI$, where $I$ is the $3\times 3$ identity matrix.
Your score of this problem is equal to that […]

Determine a Matrix From Its Eigenvalue
Let
\[A=\begin{bmatrix}
a & -1\\
1& 4
\end{bmatrix}\]
be a $2\times 2$ matrix, where $a$ is some real number.
Suppose that the matrix $A$ has an eigenvalue $3$.
(a) Determine the value of $a$.
(b) Does the matrix $A$ have eigenvalues other than […]

If Two Matrices are Similar, then their Determinants are the Same
Prove that if $A$ and $B$ are similar matrices, then their determinants are the same.
Proof.
Suppose that $A$ and $B$ are similar. Then there exists a nonsingular matrix $S$ such that
\[S^{-1}AS=B\]
by definition.
Then we […]

Determine Whether Given Matrices are Similar
(a) Is the matrix $A=\begin{bmatrix}
1 & 2\\
0& 3
\end{bmatrix}$ similar to the matrix $B=\begin{bmatrix}
3 & 0\\
1& 2
\end{bmatrix}$?
(b) Is the matrix $A=\begin{bmatrix}
0 & 1\\
5& 3
\end{bmatrix}$ similar to the matrix […]

Determinant of Matrix whose Diagonal Entries are 6 and 2 Elsewhere
Find the determinant of the following matrix
\[A=\begin{bmatrix}
6 & 2 & 2 & 2 &2 \\
2 & 6 & 2 & 2 & 2 \\
2 & 2 & 6 & 2 & 2 \\
2 & 2 & 2 & 6 & 2 \\
2 & 2 & 2 & 2 & 6
\end{bmatrix}.\]
(Harvard University, Linear Algebra Exam […]

Eigenvalues and their Algebraic Multiplicities of a Matrix with a Variable
Determine all eigenvalues and their algebraic multiplicities of the matrix
\[A=\begin{bmatrix}
1 & a & 1 \\
a &1 &a \\
1 & a & 1
\end{bmatrix},\]
where $a$ is a real number.
Proof.
To find eigenvalues we first compute the characteristic polynomial of the […]

All the Eigenvectors of a Matrix Are Eigenvectors of Another Matrix
Let $A$ and $B$ be an $n \times n$ matrices.
Suppose that all the eigenvalues of $A$ are distinct and the matrices $A$ and $B$ commute, that is $AB=BA$.
Then prove that each eigenvector of $A$ is an eigenvector of $B$.
(It could be that each eigenvector is an eigenvector for […]

You can confirm the calculation as follows. I think it is easier to think backward.

First $S^{-1}(A-tI)S = S^{-1}AS – S^{-1}(tI)S$ by distributing $S{-1}$ and $S$.
1
Now look at the second term $S^{-1}(tI)S$. As $t$ is just a scalar (number), we have

$S^{-1}(tI)S = t S^{-1}IS = tS^{-1}S= t I$ by the propaty of the identity matrix and inverse matrix.

Combining these we get the desired equality. Let me know if you have further questions.

[…] We recall that if $A$ and $B$ are similar, then their traces are the same. (See Problem “Similar matrices have the same eigenvalues“.) We compute begin{align*} tr(A)=0+3=3 text{ and } tr(B)=1+3=4, end{align*} and thus […]

What property allows us to move the tI term from the outside to matrix A at the start of line 2?

Dear Owen,

You can confirm the calculation as follows. I think it is easier to think backward.

First $S^{-1}(A-tI)S = S^{-1}AS – S^{-1}(tI)S$ by distributing $S{-1}$ and $S$.

1

Now look at the second term $S^{-1}(tI)S$. As $t$ is just a scalar (number), we have

$S^{-1}(tI)S = t S^{-1}IS = tS^{-1}S= t I$ by the propaty of the identity matrix and inverse matrix.

Combining these we get the desired equality. Let me know if you have further questions.