Diagonalization of a symmetric bilinear form over the integers Suppose $H$ is an $n\times n$ symmetric matrix with integer entries. We can view $H$ as a symmetric bilinear form $H:\Bbb R^n\times \Bbb R^n\to \Bbb R$ defined by $H(v,w)=v^tAw$. It is then well known that $H$ is diagonalizable (http://www.math.toronto.edu/~jkamnitz/courses/mat247_2014/bilinearforms2.pdf, Theorem 1.4, for example), i.e. there is an invertible matrix $P$ such that $P^t HP$ is diagonal.
On the other hand, we can view $H$ as a symmetric bilinear form $\Bbb Z^n\times \Bbb Z^n\to \Bbb Z$. Suppose $\det H=\pm 1$ and that $H$ is negative definite. Then can we find an invertible matrix $P\in GL(n,\Bbb Z)$ such that $P^t HP$ is diagonal?

No. These matrices define positive definite (by taking $-H$) unimodular lattices; if $-H$ is diagonalizable then the diagonal entries must all be equal to $1$, so the corresponding lattice must be isomorphic to $\mathbb{Z}^n$ with the usual Euclidean inner product. The smallest example of a positive definite unimodular lattice not isomorphic to $\mathbb{Z}^n$ occurs in dimension $8$ and is given by the $E_8$ lattice. It cannot be isomorphic to $\mathbb{Z}^n$ because it is even, meaning that $H(v, v)$ is always even.
