If $A$ is a matrix of size $n\times n$, and $A^2+A+2I=0$, check whether $A$ is singular or not and find its inverse if it exists.
I can find the inverse by simply multiplying the given equation with $A^{-1}$.
$$A+I+2A^{-1}=0$$
$$A^{-1}=-\frac{1}{2}(A+I)$$
But how can I check if its singular or not?