Let $ (M,g) $ be a closed parallelizable Riemannian manifold. Whenever one comes across the standard trick of choosing a local basis $(e_1, \ldots, e_n)$ of $TM$ for some computation in local coordinates, when are we allowed to freely extend $e_i$ to a global nowhere zero vector field $X_i$ such that $(X_1, \ldots, X_n)$ is a global basis of $TM$? It seems to me this should give no problem when we're dealing with a coordinate independent computation, for example with tensor fields. Is there some subtlety one must be careful with when wanting to extend a local frame to a global frame in general?
Perhaps to give a specific example, if $(e_1, \ldots, e_n)$ is our local frame on a coordinate chart $U$, and the coefficients of the metric tensor $g$ are $g_{ij} = g(e_i, e_j)$, can we really find a global frame $(X_1, \ldots, X_n)$ such that $g(X_i, X_j)$ coincides with $g_{ij}$ over $U$? That is, the components of the metric tensor can be globally defined smooth functions?