In the study of metric space, I've encountered two kinds of distances between 2 functions:
1)
$\begin{array}{l}{\text { Let } a<b \text { and } X=C([a, b]) \text { be the set of continuous functions } f:[a, b] \rightarrow \mathbb{R} . \text { Let }} \\ {d_1(f, g)=\sup _{x \in[a, b]}|f(x)-g(x)| . \text { Then } d \text { is a distance on } X . }\end{array}$
2)
$\begin{array}{l}{\text { Consider the set } X=C([a, b]) \text { and set } d_2(f, g)=\int_{a}^{b}|f(x)-g(x)| \mathrm{d} x . \text { Then } d \text { is a }} \\ {\text { distance on } X }\end{array}$
The first distance is clearly the maximum between the difference of these two functions which is, in fact, a distance.
But, the second distance involve an integral which calculates the area under a curve, in our cases the value of $d_2$ would give us the area between these 2 functions.
My question is: How could an area be equivalent to a distance? And what would the number associated to $d_2$ represent (i.e. the length of what)?
A metric space consists of a set $X$ and a function $d : X \times X \to [0, \infty)$ satisfying the properties
The function $d$ is called a metric. That's it; that's the definition in its entirety. The intuition behind this definition is that $d$ is supposed to act as something analogous to a distance function, but there are no more actual requirements than the above three conditions.
So, as you've found here, most sets do not have unique metrics (actually, they have unique metrics if and only if they're singletons). But that is OK. Maybe a more intuitive example is the Manhattan metric on $\Bbb{R}^2$: $$d_1((a, b), (c, d)) = |a - c| + |b - d|.$$ This is a very natural metric when, navigating the streets of Manhattan, as (so I'm told) the streets form a rectangular grid. So, if you want to get from one street intersection to another, you must follow streets going north/south, or east/west.
Or, if you're a bird flying in Manhattan, then a more appropriate metric might be the Euclidean metric $$d_2((a, b), (c, d)) = \sqrt{(a - c)^2 + (b - d)^2},$$ as you can just fly over the streets and buildings.
Note: two different notions of distance, each on the same set, each more applicable than the other in certain circumstances. It's the same thing going on here.