The inverse of a diagonal matrix with nonzero entries is the diagonal of reciprocals: \(\frac12,\,-\frac14,\,\frac15\). The sign is kept because the reciprocal of a negative number is negative.
The inverse of a square matrix \(A\) is the matrix \(A^{-1}\) that gives the identity \(I\) when multiplied by \(A\) on either side; if it exists, \(A\) is called invertible.