[proofplan]
Use the finite spectral decomposition of $A$ and linearity. For a pure state, apply the decomposition to $\psi$ and use self-adjoint idempotence of each projection to identify $(P_k\psi,\psi)_H$ with $\|P_k\psi\|_H^2$. For a density operator, multiply the spectral decomposition by $\rho$ and use finite-dimensional trace linearity.
[/proofplan]
[step:Expand the pure-state expectation through the spectral projections]
Let $H$ be the finite-dimensional complex Hilbert space in the statement, let $\psi\in H$ satisfy $\|\psi\|_H=1$, and let
\begin{align*}
A=\sum_{k=1}^m a_kP_k
\end{align*}
be the spectral decomposition from the statement. Since the sum is finite and the inner product is linear in its first argument,
\begin{align*}
(A\psi,\psi)_H=\sum_{k=1}^m a_k(P_k\psi,\psi)_H.
\end{align*}
Each $P_k$ is an orthogonal projection, so $P_k^*=P_k$ and $P_k^2=P_k$. Therefore
\begin{align*}
(P_k\psi,\psi)_H=(P_k^2\psi,\psi)_H=(P_k\psi,P_k\psi)_H=\|P_k\psi\|_H^2.
\end{align*}
Substituting this identity into the previous finite sum gives
\begin{align*}
(A\psi,\psi)_H=\sum_{k=1}^m a_k\|P_k\psi\|_H^2.
\end{align*}
[guided]
The vector-state expectation is obtained by inserting the spectral resolution into the inner product. The decomposition says
\begin{align*}
A=\sum_{k=1}^m a_kP_k.
\end{align*}
Applying both sides to the unit vector $\psi$ gives
\begin{align*}
A\psi=\sum_{k=1}^m a_kP_k\psi.
\end{align*}
Because the sum is finite, linearity of the inner product in the first variable gives
\begin{align*}
(A\psi,\psi)_H=\sum_{k=1}^m a_k(P_k\psi,\psi)_H.
\end{align*}
It remains to interpret the scalar $(P_k\psi,\psi)_H$ as a probability. Since $P_k$ is an orthogonal projection, it is self-adjoint and idempotent: $P_k^*=P_k$ and $P_k^2=P_k$. Hence
\begin{align*}
(P_k\psi,\psi)_H=(P_k^2\psi,\psi)_H=(P_k\psi,P_k\psi)_H=\|P_k\psi\|_H^2.
\end{align*}
Thus the expectation is the weighted sum of the spectral values $a_k$ with weights $\|P_k\psi\|_H^2$:
\begin{align*}
(A\psi,\psi)_H=\sum_{k=1}^m a_k\|P_k\psi\|_H^2.
\end{align*}
[/guided]
[/step]
[step:Use trace linearity for density operators]
Let $\rho:H\to H$ be a density operator. Multiplying the spectral decomposition of $A$ on the left by $\rho$ gives
\begin{align*}
\rho A=\sum_{k=1}^m a_k\rho P_k.
\end{align*}
The trace on the finite-dimensional operator algebra $\operatorname{End}(H)$ is linear, so
\begin{align*}
\operatorname{tr}(\rho A)=\sum_{k=1}^m a_k\operatorname{tr}(\rho P_k).
\end{align*}
This is the desired density-operator formula.
[/step]