'Ambiguity' of dual vectors $\{dx^i\}$ in cotangent space in general relativity The metric tensor is defined as:
$$g = g_{ij}dx^i \otimes dx^j,$$
where I used the summation convention. We often omit the tensor product sign $\otimes$ and just write this as: 
$$g = g_{ij}dx^idx^j.$$
My question is about the line element which is also written as:
$$ds^2 = g_{ij}dx^i dx^j.$$
I will describe what I already know about the metric tensor and line element below.
Suppose we have a Riemannian manifold $M$, then we can define at every point $p\in M$ a metric. This give raise to the metric tensor field (so for every point $p$ we get a tensor:), so $g_p: T_p M\times T_p M\rightarrow \mathcal{R}$, where $\mathcal{R}$ are the real numbers. The coordinates $\{x^i\}$ are then local coordinates at $p$. From this notion we can define the length of a path $\gamma : [a,b]\rightarrow M $ with the property that $\gamma(t)\in M$ for $t\in[a,b]$. We can define the length of this path as:
$$L_\gamma = \int^b_a\sqrt{\pm g_{ij}\frac{dx^i}{dt}\frac{dx^j}{dt}}dt = \int^b_a\sqrt{\pm g_{ij}dx^idx^j}=\int^b_ads.$$
Where the $\pm$ ensures that we get a real solution.
From this we see that the line element can be defined as:
$$ds^2 = g_{ij}dx^idx^j.$$
The problem that I have with this, is that $L_\gamma \in \mathcal{R}$ is a real number. It now seems that we did not use the idea that $dx^i$ is a dual vector in the cotangent space defined at every point $p \in M$, but that we now regard those differentials as infinitesemal displacements (since only then they add up to a length). 
I am not sure what happens here, I also read other posts but they seem to skip the point that the dual vectors $dx^i$ get an ambiguous meaning. For example if we consider the arc length in Cartesian coordinates and we let $M=\mathcal{R}^2$, then we get the following expression for the length of some curve:
$$L = \int^b_a \sqrt{dx^2+dy^2},$$
but how is this elementary notion of calculus consistent with the idea that $dx^i$ is a dual vector (so that $dx^2$ would actually be a tensor of rank (0,2))? Now it seems that everyone just assumes that the square root of the metric tensor is well-defined and that this evaluates to a scalar. Could somebody elaborate a bit more on this idea? The idea what a length and the metric tensor and so on is, is quite clear for me. 
 A: Given a curve $\gamma:I\to M$, one can pull back the (positive definite) metric tensor $${\bf g}~=~ g_{ij}\mathrm{d}x^i \odot \mathrm{d}x^i~\in~ \Gamma\left( {\rm Sym}^2(T^{\ast}M)\right)\tag{A}$$ to 
$$\omega\odot\omega~:=~\gamma^{\ast}{\bf g}~\in~ \Gamma\left( {\rm Sym}^2(T^{\ast}I)\right),\tag{B}$$
where the 1-form $\omega$ is locally exact $$\omega~=~\mathrm{d}s\tag{C}$$ because of Poincare lemma $\mathrm{d}\omega=0$. Now to get a function on both sides of eq. (B) insert a vector field $X\in  \Gamma(TI)$ twice on both sides of eq. (B). This will essentially reproduce what physicists mean by the formula
$$ ds^2 ~=~g_{ij}dx^idx^j. \tag{D} $$
A: The mismatch with the notations
$$g= g_{ij}dx^i\otimes dx^j$$ and 
 $$ds^2 = g_{ij}dx^idx^j$$ is due to the fact that, in this  second formula the $dx^k$s correspond to "small" components of contravariant vectors $\delta X$ (the $dx^k$s are real numbers here) instead of elements of the dual basis (the $dx^i$ are covariant vectors in the rigorous view). Replacing in the second formula $dx^k$ with a less ambiguous notation $\delta x^k$,
$$\delta X = \delta x^k \frac{\partial}{\partial x^k}$$
Therefore we have the identity connecting the two notions
$$ g_{ij} \delta x^i \delta x^j = g(\delta X, \delta X) = \delta s^2\:.$$
 This interpretation is also in agreement with the integral defining the length of a curve provided we write $\dot{\gamma} dt = \delta x^i  \frac{\partial}{\partial x^i}$, so that the formula for computing the length of a curve becomes
$$L_\gamma = \int_a^b \sqrt{|g(\dot{\gamma},\dot{\gamma})|} dt = \int \sqrt{|g_{ij}\delta x^i\delta x^j|}\:.$$
The point is that the objects $\delta x^k$ do not exist as "infinitesimal numbers" (unless taking advantage of the nonstandard analysis) while the objects $dx^i$ do exist as vectors in a suitable vector space and this notation is therefore more rigorous from the mathematical viewpoint. 
Why do the two ideas work in agreement? The reason is that infinitesimal is replaced, in the modern view, with linear approximation (first order Taylor expansion neglecting infinitesimals of higer order) and vectors are linear structures embodying the information of these linear approximations. 
