Each point of $M$ has a smooth coordinate neighborhood in which the coordinate frame is orthonormal iff $g$ is flat Let $(M,g)$ be a Riemannian manifold. Then I want to show that these are equivalent:

(i) Each point of $M$ has a smooth coordinate neighborhood in which the coordinate frame is orthonormal.
(ii) $g$ is flat.

Here's what I've tried:
(i)$\Rightarrow$(ii): Let $p$ be a point in $M$. Assume it has a smooth coordinate neighborhood in which the coordinate frame is orthonormal, i.e., a local frame $(E_1,...,E_n)$ on an open set $U$ around $p$ such that $\langle E_i,E_j\rangle_g=\delta_{ij}$. Since $M$ is a smooth manifold, $U$ is diffeomorphic to an open subset of $\mathbb{R}^n$ by the diffeomorphism $F$. So, it suffices to  show that $F^\ast g= \tilde{g}$, where $\tilde{g}$ is Euclidean metric. By the definition of Riemannian metric, this is true. (Is this true really?)
(ii)$\Rightarrow$(i): Assume $g$ is flat, i.e., every point $p$ in $M$ has a neighborhood $U$ such that $(U,g|_U)$ is isometric to an open subset of $\mathbb{R}^n$ with the Euclidean metric. So $U$ is diffeomorphic to an open subset of $\mathbb{R}^n$ and $F^\ast g= \tilde{g}$, where $\tilde{g}$ is Euclidean metric. Since ($\partial/\partial x^i$) is an orthonormal frame in $\mathbb{R}^n$, it gives an orthonormal frame in $U$. (I don't know how.)
Thanks in advance.
 A: It seems you only want to know how to get that frame? 
Assume $F:U\rightarrow V\subset \mathbb{R}^n$ is a diffeomorphism on all of $U$ with image (precisely) $V$.
Let $X_i := \frac{\partial}{\partial x_i}$ (easier to LaTex...)
If you then let $E_i = (F^{-1})_* X_i$ (that is: $E_i(p) := (F^{-1})_{*, F(p)} X_i(F(p))$ for $q= F(p) \in V$ )
 then you have by definition of the pullback
$$F^*g(E_i,E_j)= F^*g((F^{-1})_* X_i,(F^{-1})_* X_j)) = \tilde{g} (F_* (F^{-1})_* X_i,F_* (F^{-1})_* X_j)) = \tilde{g}(X_i,X_j)=\delta_{ij}$$
A: The key word in the question is the coordinate neighborhood, so a clear definition of it would help.
Definition 1. A coordinate neighborhood of a point $p \in M$ is an open subset $U \subset M$ endowed with a collection of functions $x^i \colon U \rightarrow \mathbb{R}$, where $i=1,\dots,n$, such that the map
$$
\textbf{x} \colon U \rightarrow \mathbb{R}^n \colon p \mapsto
\left(\begin{array}{c}
x^{1}\\
\vdots\\
x^{n}
\end{array}\right)
$$
is a diffeomorphism onto its image. Briefly it is denoted by $(U,x^i)$. The functions $x^i$ are called the coordinate functions. The corresponding coordinate vector fields $\partial_i := \frac{\partial}{\partial{x^i}}$ are defined as the partial derivatives w.r.t. to coordinate $x^i$, so that $\partial_i x^j = \delta_i^j$. No Riemannian structure is involved so far.
There is so called the standard frame $(E_i \in \Gamma(T \mathbb{R}^n))$ in $\mathbb{R}^n$ such that $E_i = (0,\dots,1,\dots,0)$ with $1$ in the $i$-th position. The Euclidean metric $g^E \in \Gamma(S^2 T \mathbb{R}^n)$ is defined by
$$
g^E(E_i,E_j)=\delta_{ij}
$$
The coordinate frame $(\partial_i)$ is the pullback of the standard frame $(E_i)$ by map $\textbf{x}$, that is
$$
\frac{\partial}{\partial{x^i}} = \textbf{x}^*E_i
$$
Now, let $U$ be an open subset of a Riemannian manifold $(M,g)$. A smooth map 
$$
F \colon (U,g|_U) \rightarrow (\mathbb{R}^n, g^E)
$$
is an isometry onto its image if $F_*g=g^E$ or, equivalently, $g = F^*g^E$. Recall, that for a diffeomorphism $F$ the pull-back is the inverse of the pushforward: $F^* = (F_*)^{-1}$.
As one can see from the question, the OP uses the following
Definition 2. A Riemannian metric $g$ on a smooth manifold $M$ is called locally flat if for any point $p \in M$ there is an open neighborhood $U$ of $p$ such that $U, g|_U$ is isometric to an open subset of $(\mathbb{R}^n, g^E)$. For brevity, the term "flat metric" is often used instead.
Let me restate slightly the fact in the question as the following
Proposition. For an open subset $U$ of a Riemannian manifold $(M.g)$ the following conditions are equivalent.
(i) $U$ is a "coordinate neighborhood" (of any of its points) in which the coordinate frame is orthonormal;
(ii) $(U,g|_U)$ is isometric to an open subset of $(R^n, g^E)$.
Proof.
$(i) \Rightarrow (ii)$ Check that map $\textbf{x} \colon U \rightarrow (R^n, g^E)$ provides the necessary isometry, i.e. $g = \textbf{x}^* g^E$. Indeed,
$$
g_{ij}=g(\partial_i,\partial_j)=\textbf{x}^* g^E(\partial_i,\partial_j) = g^E(\textbf{x}_* \partial_i, \textbf{x}_* \partial_j) = g^E (E_i, E_j) = \delta_{ij}
$$
which exactly means that the coordinate frame $(\partial_i)$ is orthonormal.
$(ii) \Rightarrow (i)$ Let $F: (U,g|_U) \rightarrow (\mathbb{R}^n,g^E)$ be an isometry. Define
$$
x^i (p) := F^i (p)
$$
i.e. $\mathbf{x} = F$. Now $(U,x^i)$ is a "coordinate neighborhood". QED.
As one can see, this is in fact a tautology: everything is hidden in the definitions!
