In general, this cannot be done.  For example, in dimension $2$ in coordinates $(x,y)$, let 
$$
G(x,y) = \left[\begin{matrix}x&y\\y&-x\end{matrix}\right].
$$
If $G$ could be diagonalized by a differentiable invertible matrix $A(x,y)$, i.e., if
$$
A^T G A = \left[\begin{matrix}\lambda_1&0\\ 0&\lambda_2\end{matrix}\right]
$$
where $\lambda_1$ and $\lambda_2$ were differentiable, then the $\lambda_i$ would have to vanish at $x=y=0$. Taking determinants yields
$$
-(x^2+y^2)(\det A)^2 = \lambda_1\lambda_2\,.
$$
Then, looking at the lowest order terms on each side (the terms of order $2$), you'd have $x^2+y^2$ written as a product of two factors linear in $x$ and $y$, which is impossible.

For similar reasons, you cannot achieve 
$$
G = A^T\left[\begin{matrix}\lambda_1&0\\ 0&\lambda_2\end{matrix}\right]A
$$
for a differentiable $A$ and $\lambda_i$.  The above argument shows that $A$ could not be invertible, so we would have to have $\det A$ vanishing at $x=y=0$.
Then $-(x^2+y^2) = (\det A)^2\lambda_1\lambda_2$ would imply that $\det A$ vanishes at most to order 1 at $x=y=0$ and that $\lambda_1$ and $\lambda_2$ do not vanish at $x=y=0$, which again gives a contradiction, since $x^2+y^2$ is not the square of a linear term.