When is a symmetric 2-tensor field globally diagonalizable? Suppose that $\mathbb{R}^n$ has a Riemannian metric $g$.  Let $h$ be a smooth symmetric 2-tensor field on $\mathbb{R}^n$.
At any point $p \in \mathbb{R}^n$, there is a basis of $T_p \mathbb{R}^n$ in which $h$ is diagonal.  Is it always possible to find a global orthonormal frame $\{E_i\}$ that diagonalizes $h$?
If not, what are the obstructions to the existence of such a frame?

Once I had similar question. I asked if you are given continuous matrix valued function $A:\Omega \rightarrow \mathbb{R}^{n\times n}$. Can you find continuous matrix valued functions $D$  diagonal and $S$ orthogonal, such that 
$$
A(x) = S(x)D(x)S^T(x)
$$
for all $x\in \Omega$ ?
The answer is negative. Take this matrix valued function:
$$
A(x)=\left( 
\begin{matrix}
1 + \phi(x) \sin^2{\theta(x)} & - \phi(x)\cos{\theta(x)} \sin{\theta(x)}\\
- \phi(x)\cos{\theta(x)} \sin{\theta(x)} & 1 + \phi(x) \cos^2{\theta(x)}
\end{matrix} 
\right) = 
\left( 
\begin{matrix}
\cos{\theta(x)} & -\sin{\theta(x)} \\
\sin{\theta(x)} & \cos{\theta(x)}
\end{matrix} 
\right)
\left(
\begin{matrix}
1 & 0 \\
0 & 1+\phi(x) 
\end{matrix} 
\right)
\left( 
\begin{matrix}
\cos{\theta(x)} & \sin{\theta(x)} \\
-\sin{\theta(x)} & \cos{\theta(x)}
\end{matrix} 
\right) = S(x)D(x)S^T(x)
$$
If you now take $\Omega = \mathbb{R}$, $\phi(x) = |x|$, $\theta(x) = \frac1{|x|}$, $\theta(0)=0$. Than $A$ is continuous but $S$ is not. And since eigen value decomposition is unique(apart from some signs and permutations) this is counter example.
If you require $A$ to be differentiable than pick $\phi(x) = |x|^n$ with sufficiently high $n$.
If you need $A$ to be infinitely differentiable than I would pick $\phi(x) = e^{-\frac1{x^2}}$
