Consider $A_{n \times n}$ is invertible, so $AA^{-1} = A^{-1}A = I$.
Now, what I wonder is if we have lets say $(I + AB)_{n\times n}$ (an arbitrary matrix),
So is it possible to diminish $A$ and $A^{-1}$ in this situation:
$A(I+AB)A^{-1} \rightarrow (I+AB)\;?$
- Answer: Not in general, and not in most cases.
Matrix multiplication is not commutative, as is scalar multiplication. So trying to simplify $A(I+AB)A^{-1}$ to obtain $I + AB$ is not "the same as saying" $4 \times X \times {1 \over 4} = 4 \times (\frac{1}{4} \times X) = (4\times \frac{1}{4}) \times X = X$ which is true simply because scalar multiplication and scalar multiplication of a matrix are commutative.
That said, your result holds whenever $AB = BA$, for matrices $A, B$.
One added thought: You are correct that a matrix $A$ is invertible if and only if there is a matrix $A^{\prime}$ such that $AA^{\prime} = A^{\prime} A = I.$ Then we call $A^{\prime}$ the inverse of $A$ and denote it $A^{-1}$. By the definition of an inverse of a matrix $A$, if invertible, it is true that $A$ commutes with its inverse. But it does not follow that $A$ then commutes with every matrix.