Finding local orthonormal frame on a Pseudo-Riemannian Manifold Suppose we have a semi-Riemannian manifold $(M^n,g)$ with metric signature $(n-k,k)$. By definition, each $p \in M$ the map $g_p : T_pM \times T_pM \to \Bbb{R}$ is a non-degenerate, symmetric, bilinear form. 

How to find a local orthonormal frame on a neighbourhood $U \subseteq M$ of a point $p \in M$ ? That is $n$-tuple of local vector fields $(X_1,\dots,X_n)$ defined on a neighbourhood of a point such that for any $p \in M$, $(X_1|_p,\dots,X_n|_p)$ is linearly independent, $\text{span }(X_1|_p,\dots,X_n|_p) = T_pM$ and $g_p(X_i|_p,X_j|_p) = \pm \delta_{ij}$. I've seen such construction for Riemannian manifold in Lee's smooth manifolds which using Gram-Schmidt procedure. Using similar idea as in Lee's, i came up with this following construction. The problem with using the same strategy (Gram-Schimdt) is that since $g_p$ is indefinite, the normalizing function $1/|\cdot| = 1/\sqrt{|g(\cdot,\cdot)|}$ is not automatically smooth function since $g(\cdot,\cdot)$ can vanish somewhere. However, i may get a way with this issue but not really sure. I need some opinion and justification for this.

$\textbf{Choosing a local frame}$ 
Let $p \in M$ be arbitrary point and $\{v_1,\dots,v_n\}$ be an orthonormal basis for $T_pM$. Having this, we can find  a smooth local frame $(X_1,\dots,X_n)$ on some neighbourhood $U\subseteq M$ of $p$ such that $X_i|_p=v_i$ for all $i =1,\dots,n$ (See John Lee's Introduction to Smooth Manifolds 2nd Ed, Proposition 8.11). 
$\textbf{Normalizing}$
We normalize them as follows: Since  $g(X_1,X_1): U \to \Bbb{R}$ is a smooth function with $g(X_1,X_1)(p) = g_p(X_1|_p,X_1|_p) =g_p(v_1,v_1)= \pm 1$, then by continuity we have a smaller neighbourhood $U_1 \subseteq U$ of $p$ such that $g(X_1,X_1)$ is strictly positive or strictly negative in this region, depends on the sign $g_p(v_1,v_1)=\pm 1$. Because of this $|X_1| = \sqrt{|g(X_1,X_1)|}$ is a non-vanishing smooth vector field on $U_1$, then we can normalize $X_1$, by setting 
$$
E_1 =  \frac{X_1}{|X_1|}.
$$
Similarly, the vector $V_2 = X_2 - \varepsilon_1 g(X_2,E_1)E_1$ is a smooth vector field with  $g(V_2,V_2)(p) = g_p(V_2|_p,V_2|_p) = g_p(v_2,v_2) = \pm 1$. So $g(V_2,V_2) $ has a neighbourhood $U_2 \subseteq U$ of $p$ such that it has only positive or negative values. So we have normalized smooth vector field
$$
E_2 = \frac{X_2 - \varepsilon_1 g(X_2,E_1)E_1}{|X_2 - \varepsilon_1 g(X_2,E_1)E_1|}, \quad \varepsilon_1=g(E_1,E_1)=\pm1
$$
defined on $U_1 \cap U_2$ and with $g(E_2,E_1) = 0$. 
Working inductively, we have $n$-tuple of smooth vector fields $(E_1,\dots,E_n)$ defined on $W = U_1 \cap \cdots \cap U_n$ given by 
$$
E_j = \frac{X_j - \sum_{i=1}^{j-1} \varepsilon_i \, g(X_j,E_i)E_i}{|X_j - \sum_{i=1}^{j-1} \varepsilon_i \, g(X_j,E_i)E_i|}  
$$
with  $\varepsilon_i=g(E_i,E_i)=\pm1$. By construction $g(E_i,E_j) = 0$ for $i \neq j$ and $g(E_i,E_i) = \pm 1$, and $\text{span}(X_1,\dots,X_n) = \text{span}(E_,\dots,E_n)$.

Is this correct ? Is there any simpler approach ? Any help will be appreciated. Thank you.

$\textbf{EDIT}$
I just want to tell that i've found a similar construction using GS method in Darling's Differential Form and Connection section 7.7
 A: Yes, this is basically fine. One small correction: You wrote

Because of this $|X_1| = \sqrt{|g(X_1,X_1)|}$ is a non-vanishing
  smooth vector field on $U_1$, ...

But $|X_1|$ is not a vector field. It should say 

Because of this $|X_1| = \sqrt{|g(X_1,X_1)|}$ is a non-vanishing
  smooth function on $U_1$, ...

A: Let $(M,g)$ be a pseudo-Riemannian $n$-manifold and $p\in M$ be an arbitrary point.
Consider a local frame $(\partial_1,\dots,\partial_n)$ in some coordinate neighbourhood $U\ni p$
and an arbitrary orthonormal basis $(V_1,\dots,V_n)$ in $T_pM$.
We have $(V_1,\dots,V_n)=((\partial_1)_p,\dots,(\partial_n)_p) A$ for the transition matrix $A\in\mathbb{R}^{n\times n}$,
so we can set a new local frame $(X_1,\dots,X_n)$ with $((X_1)_q,\dots,(X_n)_q)=((\partial_1)_q,\dots,(\partial_n)_q) A$ for all $q\in U$.
Since $g_p((X_i)_p,(X_j)_p)=g_p(V_i,V_j)$ and $g(X_i,X_j)\in\mathfrak{F}(U)$, then by continuity
there exists an open neighbourhood $W\subseteq U$ of $p$ such that 
\begin{equation*}
\lvert{g(X_i,X_i)}\rvert >a=\frac{3}{4}+\frac{1}{3n}<1 \mbox{ and } \lvert{g(X_i,X_j)}\rvert <b=\frac{1}{6n} \mbox{ for all } 1\leq i\neq j\leq n.
\end{equation*}
Let us apply the Gram-Schmidt process to create an orthogonal local frame $(Y_1,\dots,Y_n)$ on $W$ such that
\begin{equation*}
\lvert{g(Y_j,Y_j)}\rvert >d=\frac{3}{4} \mbox{ and } \lvert{g(Y_j,X_k)}\rvert <c=\frac{1}{2n} \mbox{ for all } 1\leq j < k\leq n.
\end{equation*}
We start with $Y_1=X_1$.
Suppose that we inductively set $(Y_1,\dots,Y_{j-1})$ for some $2\leq j\leq n$ and define
\begin{equation*}
Y_j=X_j-\sum_{i=1}^{j-1}\frac{g(X_j,Y_i)}{g(Y_i,Y_i)}Y_i.
\end{equation*}
It is clear that $g(Y_j,Y_i)=0$ for $1\leq i\leq j-1$. Additionally we have,
\begin{align*}
\lvert{g(Y_j,Y_j)}\rvert&=\left\lvert{g(X_j,X_j)-\sum_{i=1}^{j-1}\frac{(g(X_j,Y_i))^2}{g(Y_i,Y_i)}}\right\rvert\\
&\geq \lvert{g(X_j,X_j)}\rvert-\sum_{i=1}^{j-1}\frac{\lvert{g(X_j,Y_i)}\rvert^2}{\lvert{g(Y_i,Y_i)}\rvert}>a-n\frac{c^2}{d}=d,\\
\lvert{g(Y_j,X_k)}\rvert&=\left\lvert{g(X_j,X_k)-\sum_{i=1}^{j-1}\frac{g(X_j,Y_i)g(Y_i,X_k)}{g(Y_i,Y_i)}}\right\rvert\\
&\leq \lvert{g(X_j,X_k)}\rvert+\sum_{i=1}^{j-1}\frac{\lvert{g(X_j,Y_i)\rvert} \lvert{g(Y_i,X_k)}\rvert}{\lvert{g(Y_i,Y_i)}\rvert}<b+n\frac{c^2}{d}=c.
\end{align*}
Since $\lVert{Y_i}\rVert=\sqrt{\lvert{g(Y_i,Y_i)}\rvert}\in\mathfrak{F}(W)$ is non-vanishing we can set $E_i=Y_i/\lVert{Y_i}\rVert\in\mathfrak{X}(W)$ for each $1\leq i\leq n$,
and get a desired orthonormal local frame $(E_1,\dots,E_n)$ on $W\ni p$.
