First, compute \( A^2 \):
\[
A^2 = \begin{bmatrix} 3 & 1 \\ -1 & 2 \end{bmatrix} \cdot \begin{bmatrix} 3 & 1 \\ -1 & 2 \end{bmatrix}.
\]
Then verify:
\[
A^2 - 5A + 7I = 0.
\]
For \( A^{-1} \), use:
\[
A^{-1} = \frac{1}{\text{det}(A)} \text{adj}(A).
\]