In general, this can not 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 (i.e., the terms of order $2$), you'd have $x^2+y^2$ written as the product of two linear factors in $x$ and $y$, which is impossible.

Similarly, 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$.