A is invertible if and only if det(A)≠0. Let's compute the determinant of A and find the values k for which it is nonzero.
Using Sarrus's rule, we obtain that
Note that the determinant is a quadratic equation on k, which can be factored as above.
Now the determinant is only zero if k=5 or k=2 (the zeroes of the quadratic polynomial). Therefore, if k≠2,5 the determinant is nonzero so A is invertible.