Metric tensor derivation, is this introduction decent I have a homework assignment to complete. We are required to derive a metric tensor, for use in curved spacetime, using our own notation and language. I don't want to get too far and find myself down a rabbit hole, so I would very much appreciate comments on my opening paragraph so I can proceed with confidence.

"A vector space has orthonormal basis vectors $\textbf{b}_1,...,\textbf{b}_n$ with alternative local bases $\textbf{e}_1,...,\textbf{e}_n$ and $\textbf{e}^1,...,\textbf{e}^n$, at point $P$ so that $P$ has position vector $\textbf{r}=\sum_{k=1}^n x_k\textbf{b}_k = \sum_{k=1}^n r^k\textbf{e}_k =\sum_{k=1}^n r_k\textbf{e}^k $ with bijective once differentiable functions $(r_1,...,r_n)\rightarrow (x_1,...,x_n)$; $(x_1,...,x_n)\rightarrow (r_1,...,r_n)$; $(r^1,...,r^n)\rightarrow (x_1,...,x_n)$; $(x_1,...,x_n)\rightarrow (r^1,...,r^n)$. Since $\textbf{b}_i = \frac{\partial \textbf{r}}{\partial x_i}$, define a contravariant basis $$\textbf{e}_i \equiv \frac{\partial\textbf{r}}{\partial r^i}   =  \frac{\partial}{\partial r^i} \sum_{k=1}^{n} x_k \textbf{b}_k$$ evaluated at $P$.  This leads to the definition of a covariant basis $$ \textbf{e}^i \equiv \nabla r_i = \sum_{k=1}^{n}\frac{\partial r_i}{\partial x_k}\textbf{b}_k  $$ Expanding $\textbf{e}^i \cdot \textbf{e}_j=\nabla r_i \frac{\partial\textbf{r}}{\partial r^j}$, then using  $\textbf{b}_k \cdot \textbf{b}_s  =\delta^k_s$(Kronecker delta, because the $\textbf{b}$ are orthonormal), and $\sum_{k=1}^n\frac{\partial r_i}{\partial x_k}  \frac{\partial x_k}{\partial r^j} =  \frac{dr_i}{dr^j}=\delta^i_j$   (chain rule) gives $\textbf{e}^i \cdot \textbf{e}_j  =\delta^i_j$. Define $$g_{ij} \equiv \textbf{e}_i \cdot \textbf{e}_j$$  $$g^{ij} \equiv \textbf{e}^i \cdot \textbf{e}^j$$   $$ g_j^i \equiv \textbf{e}^i \cdot \textbf{e}_j = \delta_j^i$$  where $g_{ij}, g^{ij}, g^i_j$  are metric tensors
  with $g^{ij}=g^{ji}$ and $g_{ij}=g_{ji}$. Using the Einstein summation convention, $\textbf{r} =r^i \textbf{e}_i =r_i \textbf{e}^i$ , then $\textbf{r} \cdot \textbf{e}^j = r^i \textbf{e}_i \cdot \textbf{e}^j = r^i \delta_i^j = r^j$ and the contravariant and covariant components of $\textbf{r}$ are given by $r^i = \textbf{r} \cdot \textbf{e}^i$ and $r_i = \textbf{r} \cdot \textbf{e}_i$. The scalar product may be written$$\textbf{r} \cdot \textbf{s} = r^i\textbf{e}_i s^j \textbf{e}_j =g_{ij}r^i s^j$$ $$\textbf{r} \cdot \textbf{s} = r_i\textbf{e}^i s_j \textbf{e}^j =g^{ij}r_i s_j$$ $$\textbf{r} \cdot \textbf{s} = r_i\textbf{e}^i s^j \textbf{e}_j =g^i_j r_i s^j$$"

My question regards the functions (x...x)-> (r...r) etc. If spacetime is curved these may not be bijective. If they are not bijective does this invalidate the above definition of a metric tensor. Is it correct to say I am mapping points in a non-Euclidean space to points in a Euclidean space. Regardless of the functions the tangents may not be unique, but it is possible that a combination of tangents and normals is unique.
 A: You essentially got the definition correct -- I believe that you also want to require that any transition between surfaces in your manifold $\mathcal{M}$ is 'smooth' in the sense that if $A,B\subseteq\mathcal{M}$ with $A\cap B\neq0$, and $A$ is parametrized by one of your coordinate functions $x_i$ with $B$ parametrized by another coordinate function $x_j$ (maybe on some restriction of their domains), then for any $p\in A\cap B\subseteq\mathcal{M}$ you want $$x_i\circ x_j^{-1}(p)=x_i\big(x_j^{-1}(p)\big)=p.$$ This is essentially saying that your coodinate functions paramertize the same surface where they happen to overlap, so differentiability and other topological  properties carry nicely over boundaries. 
You also might want to specify how 'differentiable' the coordinate functions are, for example $n$ times differentiable vs $\omega$ times differentiable. I'm not sure what a nonlinear function would mean in this context, but specifying how differentiable the functions are and that they overlap nicely should be sufficient. It is also true that each surface in a manifold can form a manifold itself, however this identification is not always useful. 
Your $g_{ij}$ and $g^{ij}$ do indeed take arbitrary vectors normal to $n$-dimensional surfaces and produce real numbers, so they are metric tensors in that sense.
