What is the necessary and sufficient condition when an $n \times n$ matrix over $\mathbb{Z} $ is invertible over $ \mathbb{Z}$ I read a proposition on the textbook. It says that an $n \times n$ matrix over $\mathbb{Z}$  is invertible over $\mathbb{Z}$ if and only if it can be expressed as a product of elementary matrices all of which are over $\mathbb{Z}$.
The book left the proof to readers. But I do not think that the proposition holds. For example when matrix $A = \left( \begin{array}{cc}2 & 0\\
0 & 1 \end{array}\right)$. It is elementary over $\mathbb{Z}$. But $inv(A) = \left( \begin{array}{cc}\frac{1}{2} & 0\\
0 & 1 \end{array} \right)$ which is not over $\mathbb{Z}$.
Guys where did I make the mistake?
 A: A matrix over $\mathbb Z$ is invertible iff its determinat is either $1$ or $-1$. One way of seeing this is that you know the determinant is an integer, and then use the property that $$\det (AB)=\det(A) \det (B).$$
Then, for invertibility, you need $\det (A) \det (B)= \det(I_d) =1.$
Since  $\det(A), \det(B)$ are both integers, you must have $\det(A), \det(B) =1$ or $\det(A)=\det(B) =-1$ . It is the only way you will get a product of two integers will equal $1$.
For the other side, i.e., to show an integer-valued matrix with determinat $1$
is invertible, use the cofactor expression for the inverse. It will consist of a matrix where the entries are a permutation of the original entries, all scaled by $\frac {1} {DetA}=1$
A: Given the title of the question I have the following comment.

textbook says that an n×n matrix over ℤ is invertible over ℤ if and only if it can be expressed as a product of elementary matrices all of which are over ℤ

The isn't really a usable condition for invertibility.  "Invertible determinant" is easier to apply, and for purposes of invertibility the salient fact about "expressible as product of [invertible] elementary matrices" is only that it implicitly refers to elementary matrices that are invertible.  Any product of invertible matrices is invertible, so it doesn't matter that the matrices are elementary or not.
The real content of the textbook's statement is the fact that (the invertible subset of) elementary matrices are enough to generate all of $GL_n(\mathbb{Z})$.  
