At http://en.wikibooks.org/wiki/Real_Analysis/Metric_Spaces you can find the standard definition of a metric space: a set $X$ given with a function $d:X\times X\to\mathbb{R}$ that satisfies properties 1 through 4. Later on the page it defines open ball and open set, and proves that arbitrary unions and finite intersections of open sets are open. (The page has a few mistakes; in particular, in the second paragraph of the proof, the unions should be intersections.) In other words, the open sets form a topology.

What I find remarkable is that none of properties 1 through 4 are needed for this proof. So consider a set $X$ and an arbitrary function $d:X\times X\to\mathbb{R}$. We can define open balls and open sets using the same definitions, producing a topology on $X$. Such topologies can be very different from those that arise from true metrics; for example, if $d$ is identically 0 we get the indiscrete topology.

Can we prove anything interesting about which topologies can arise this way? In particular, does every finite topology arise this way?

twotopologies. A nice example is the "counterclockwise distance" metric on $S^1$. One of the topologies you get is the "topology of counterclockwise convergence" and the other is the "topology of clockwise convergence." – Qiaochu Yuan Aug 13 '12 at 22:00