Since $M$ and $\bar M$ have equal dimension $n$, $u$ is in fact a local diffeomorphism, so it is a diffeomorphism in some open neighborhood of $p$ in $M$.
Now, it is important to note that $g$ and $\bar g$ are in general not isometric at $p$, i.e. in general
$$\left( u^*\bar g \right)_p \neq g_p \, .$$
One can, however, find a linear map $f_p$ that relates two given orthonormal bases in the tangent spaces. $g$ and $\bar g$ are then isometric at $p$ if and only if $f_p \in O_n$.
In the following, I will give you a construction that works not just at $p$, but in some neighborhood of it. You were referring to normal coordinates in the other post, so I suppose you actually want something that works not just at $p$ itself. Normal coordinates at $p$ are coordinates on the manifold itself, not in its tangent space at $p$. I suggest you take a look at the proof, where they are constructed, in your favorite differential geometry textbook. Of course, you can evaluate everything at $p$ and get the expressions in the two tangent spaces.
Now, by Silvester's law of inertia, we can find `orthonormal' coframe fields
$\theta$ on $U$ and $\bar \theta$ on $u (U)$ (which is open in $\bar M$) such that
$$g = \theta^T \cdot \delta \cdot \theta \quad \text{and} \quad \bar g = \bar{\theta}^T \cdot \delta \cdot \bar{\theta}$$
on $U$ and $u (U)$, respectively. $\delta$ is just
$$\delta = \sum_{i,j} \delta_{ij} \, \tilde{e}^i \otimes \tilde{e}^j$$
with dual basis $(\tilde{e}^i)_i$ to the standard basis $({e}_i)_i$ in $\mathbb{R} ^n$.
To explicitly construct this decomposition for say $g$ in practice, you would usually look at a coordinate representation $\kappa^*g$ of $g$ in a neighborhood of $p$, then diagonalize
$$\kappa^*g = Y^T \cdot
\begin{pmatrix}
\lambda_1 & & \\
& \ddots & \\
& & \lambda_n \\
\end{pmatrix} \cdot Y $$
and rescale $Y$ by the square root of the above diagonal matrix $D$.
This is laborious, but doable (especially with software). You then don't worry any more about the rest of the manifold and restrict yourself to coordinates, which means you identify $g$ with $\kappa^*g$ and thus $\theta$ with $\sqrt{D} \cdot Y$.
We have
$$u^*\bar g = (u_*)^T \cdot \bar g \cdot u_* = \left(\bar{\theta} \cdot u_* \right)^T
\cdot \delta \cdot \left( \bar{\theta} \cdot u_* \right) \, ,$$
which we compare with the above expression for $g$. We would have an isometry, if $\theta = \bar{\theta} \cdot u_*$. So if we want a map from $\mathbb{R}^n$
to $\mathbb{R}^n$ at each point on $U$, that "measures" how $g$ "differs from" $\bar g$, we set
$$f = \bar{\theta} \cdot u_* \cdot \theta^{-1} \, .$$
So what does $f$ do? It takes the components of a tangent vector field on $U$ with respect to the given orthonormal frame field and spits out its components with respect to the given orthonormal frame field on $u(U)$. The respective lengths are then computed via the standard inner product $\delta$.
I leave it to you to translate everything to coordinate expressions.
By assumption, we have for every $p \in M$ an $x \in N$ such that we have a linear map $F_p : T_p M \to T_x N$. We set $\phi(p) := x$. This defines a map $\phi : M \to N$. By gluing together the $F_p$ as $p$ varies over $M$, we get a map $F : TM \to TN$. By definition, the square
$$
\newcommand{\ra}[1]{\!\!\!\!\!\!\!\!\!\!\!\!\xrightarrow{\quad#1\quad}\!\!\!\!\!\!\!\!}
\newcommand{\da}[1]{\left\downarrow{\scriptstyle#1}\vphantom{\displaystyle\int_0^1}\right.}
%
\begin{array}{ccc}
TM & \ra{F} & TN \\
\da{\pi_M} & & \da{\pi_N} \\
M & \ra{\phi} & N
\end{array}
$$
commutes. Note that $\phi$ is the unique map that makes this diagram commute.
If $\phi$ were smooth and $d\phi = F$, then $F$ would be smooth. So this is certainly a necessary condition for $\phi$ to be smooth. But it is also sufficient: if $F$ is smooth, then $\pi_N \circ F$ is smooth, and this map is constant on the fibers of $\pi_M$. Since $\pi_M$ is a submersion, this implies that $\phi$ is smooth.
Best Answer
Let $X : C^{\infty}(M) \rightarrow \mathbb{R} $ such that $$ X(f_1 f_2) = f_1(p) X f_2 + f_2(p) X f_1,$$ then $F_*:T_pM \rightarrow T_{f(p)}M$ is defined as $(F_*X)(f) = X(f\circ F).$
For more information, I recommend Lee's great book "Introduction to Smooth Manifolds", chapter 3.