Why should the metrical groundform on a variety be a quadratic form? I'm learning General Relativity and I can't understand why the distance function on space time is a quadratic form $$\textrm{d}s^2=g_{\mu\nu}\textrm{d}x^{\mu}\textrm{d}x^{\nu}$$
I explain it through analogies with $\mathbb{R}^3$ in which, independently of the coordinate systems you always end with a quadratic form such as the pythagorean theorem. 
 A: It is a quadratic form straight from the definition: A quadratic form is a homogeneous polynomial of degree 2 in $n$ variables (over a field $\mathbb{F}$, but take $\mathbb{F} = \mathbb{R}$ for simplicity). 
To see this, let me write $\mathrm{d} s^2$ as $g : T_p M \times T_p M \rightarrow \mathbb{R}$, where $T_p M$ is the tangent space at a point $p$ to the space-time $M$. Thus, let $V , W \in T_p M$ and write this in local coordinates $V = V^{\mu} \partial_{\mu}$ and $W = W^{\nu} \partial_{\nu}$. Since $g$ is, by definition, linear in each argument, we have $$ g (V , W) = g_{\mu \nu} V^{\mu} W^{\nu}$$ since $\mathrm{d} x^{\mu} \left( \partial_\alpha \right) = \delta^{\mu}_\alpha$. Now one can see that $g$ is a homogenous polynomial of degree $2$ in the variables $V , W$. 
Edit: Let me add a bit more to clarify some of the language I used above. The distance function you mention $\mathrm{d} s^2$ (which I write as $g$) is a Lorentz metric by definition. That is $\mathrm{d} s^2$ is a indefinite, smooth, symmetric, blinear form on the tangent space $T_p M$ for each point $p$ in your space-time $M$ (which is, by definition, a smooth 4-manifold). Now, a reason why there is an associated quadratic form is because with every bilinear form $B : V \times V \rightarrow \mathbb{R}$ on a vector space $V$ (in our case the vector space is $V = T_p M$), there is a canonical quadratic form that we can get from $B$ by looking at its diagonal. 
I am not sure how deep you are into your study of GR, nor do I fully understand what exactly you mean by your analogy with $\mathbb{R}^3$, but everything I speak of can be found on wikipedia or a solid text on the subject such as the one here.
