How many total matrices and commutative matrices or commutative sets are possible in GL(r,Zn)?
I'm note entirely sure what you mean. However, define to be the center of your group (Z stands for Zentrum; Germany was the world's mathematical superpower before the 1930, when group theory was in its infancy). This set is the set of all elements which commute with every element in your group. It is a subgroup of (in fact, it is normal too).
In the center consists of all diagonal matrices where the elements on the diagonal are constant (e.g. they are all 3, or are all 5, or are all 23514). Thus, the set of matrices which commute with every other matrix is the set,
I hope that answers the middle bit...
What do you mean by a total matrix?
Further, swapping the th and th rows gives you the same matrix as swapping the th and th rows. Such operations correspond to invertible matrices. Thus, all the entries in the diagonals must be the same.
Therefore, is of the required form. Such a matrix clearly does commute with everything, and we are done.
(I would recommend sitting down with this proof for a while a mulling it over, as well as trying a few examples. It is kinda tricky to get your head around...)