Hint: To determine whether $\{I_n, A, \dots, A^{n^2 - 1}\}$ is linearly dependent or not, we have to see whether we can find scalars $c_0, c_1, \dots, c_{n^2-1} \in K$, not all zero, such that $$c_0I + c_1A + \dots c_{n^2 - 1}A^{n^2-1} = 0.$$ We can reformulate the left hand side by considering the polynomial, of degree at most $n^2-1$, $p(x) = c_0 + c_1x + \dots + c_{n^2-1}x^{n^2-1}$; if not all of the scalars are non-zero, then $p$ is not the zero polynomial. The above equation now becomes $p(A) = 0$. Do you know of any results about a matrix satisfying a polynomial equation?