The commuting inverses of a square matrix