Raising and lowering indices in line elements - why do we raise and lower them in line elements? My question refers to Piattella's lecture notes on cosmology. On page 15, the Euclidean line element is defined as
$$
ds^2 = \vert d\mathbf{x}\vert^2 = \delta_{ij}dx^idx^j.
$$
My first question is simply this: why do we write $\delta_{ij}$ here, when I am used to seeing the Kronecker delta written as $\delta_j^i$, with one raised index? The same question applies to a more general line element
$$
ds^2 = \vert d\mathbf{x}\vert^2 = g_{ij}dx^idx^j.
$$
That is, why do we seem to write a metric tensor with two lower indices? In other aspects of my work, involving quantum field theory, the convention is to write the standard Minkowski metric as $\eta^{ij}$, with two raised indices, as opposed to two lowered indices. Why is it different here?
My confusion with raising and lowering indices continues on page 16 of the same document. The components of the spacial Robertson-Walker metric are defined here as
$$g_{ij} = \delta_{ij} + K\frac{x_ix_j}{1-K\vert{\mathbf{x}}\vert^2}$$.
Why, in this formula, have we suddenly gone from writing lengths such as $dx^i$ with raised indices to ones such as $x_i$ with lowered ones? Any help understanding this would be greatly appreciated.
 A: In general, a $(p,q)$-tensor eats $p$ covectors and $q$ vectors and returns a real number; such an object has $p$ indices upstairs and $q$ indices downstairs.  The components of the metric tensor are written $g_{ij}$ because the metric $\mathbf g$ is a $(0,2)$-tensor which eats two vectors (and no covectors) and returns their inner product.
If you see the indices written upstairs, then you're not talking about the components of the metric - you're talking about the components of the dual metric $\tilde{\mathbf g}$, which defines an inner product on the space of covectors.  The components of the dual metric are the matrix inverse of the components of the metric, which means
$$\tilde g^{ij} g_{jk} = \delta^i_k$$
Conventionally, we drop the tilde and write the components of this object simply as $g^{ij}$, distinguishing it from the metric itself only via placement of the indices.

In Euclidean space and cartesian coordinates, the components of the metric $g_{ij}$ written out in array form are
$$g_{ij} = \pmatrix{1 & 0 &0 &0\\0&1&0&0\\0&0&1&0\\0&0&0&1} \equiv \delta_{ij}$$

My first question is simply this: why do we write $\delta_{ij}$ here, when I am used to seeing the Kronecker delta written as $\delta^i_j$, with one raised index?

Those two symbols have subtly different meanings.   They are both equal to $1$ when $i=j$ and $0$ otherwise, but the former transform as the components of a $(0,2)$-tensor (which is to be expected, since it is the metric tensor expressed in a particular choice of coordinates) while the latter transform as the components of a $(1,1)$-tensor (or a linear transformation).

In other aspects of my work, involving quantum field theory, the convention is to write the standard Minkowski metric as $\eta^{ij}$, with two raised indices, as opposed to two lowered indices.

As above, that is the Minkowski dual metric, which is a $(2,0)$-tensor.  In cartesian coordinates, the components $\eta^{ij}$ are the same as the components of $\eta_{ij}$, but the same is not true e.g. in spherical coordinates, in which case
$$\eta_{ij} = \pmatrix{-1 &0&0&0\\0&1&0&0\\0&0&r^2&0\\0&0&0&r^2\sin^2(\theta)} \qquad \eta^{ij} = \pmatrix{-1 &0&0&0\\0&1&0&0\\0&0&\frac{1}{r^2}&0\\0&0&0&\frac{1}{r^2\sin^2(\theta)}}$$

Why, in this formula, have we suddenly gone from writing lengths such as $dx^i$ with raised indices to ones such as $x_i$ with lowered ones?

If you go back a step, we have
$$\mathrm ds^2 = |\mathrm d\mathbf x|^2 + K \frac{(\mathbf x\cdot \mathrm d\mathbf x)^2}{a^2-K|\mathbf x|^2}$$
$$ = \delta_{ij} \mathrm dx^i \mathrm dx^j + K \frac{(\delta_{ij} x^i \mathrm dx^j)(\delta_{\ell m} x^\ell \mathrm  dx^m)}{a^2 - K|\mathbf x|^2}$$
Relabeling dummy indices on the second term, we have
$$\mathrm dx^2 = \left(\delta_{ij} + K \frac{(\delta_{i\ell} x^\ell \mathrm )(\delta_{jm} x^m \mathrm )}{a^2 - K|\mathbf x|^2}\right) \mathrm dx^i \mathrm dx^j$$
If we use the index-lowering convention $x_i \equiv \delta_{i\ell}x^\ell$, then comparing this expression to the general $\mathrm ds^2 = g_{ij}\mathrm dx^i \mathrm dx^j$ yields the components given in the text. As a side note, it is my personal belief that using the index-lowering convention on the coordinates is not a good idea.  It is, however, perfectly well-defined shorthand, so your mileage may vary.
