For each point p and each positive ε, let the set of points satisfying |x,p| < ε, i.e. the open ball about p, act as a base for the topology. We need to show this is a valid base. Let p be a point inside two balls. Thus p is within distance q of the center of the first ball, and within distance r of the center of the second ball, where q and r are the two radii. Let d be the difference between q and the distance from p to the center of the first ball. Think of d as the distance from p to the "edge" of the first ball. Find a second distance separating p from the edge of the second ball. Let ε be smaller than either of these distances. Now all the points within ε of p are contained within the two larger balls, thanks to the triangular inequality. Thus we have a valid base and a valid topology.

Don't forget to define the empty set as open; it isn't characterized by an open ball.

Let the metric space T have a dense set D. Let the base be the set of open balls with centers at D and rational radii, a countable set. We need to show that such a base covers every open set. Take any point x in an arbitrary open set W, build a ball of radius e about x, such that the ball is inside W, find a point y from D within e/3 of x, choose a rational radius between e/3 and e/2, and we have a base set centered at y that contains x, and is contained in W. Thus W is covered, and we have a countable base.

Conversely, given a countable base, choose any point from each base set to build the dense set D. Every open set contains base sets, and points from D.

Let a b and c be the lengths of the sides of a triangle, thus c ≤ a+b. Since g is increasing, g(c) ≤ g(a+b). We only need show that g(a)+g(b) is even larger than g(a+b).

Hold a fixed and let x be a continuous variable that starts at 0 and increases through b and beyond. Let h(x) = g(a)+g(x)-g(a+x). Note that h(0) = 0. The derivative of h is g′(x)-g′(a+x). If this is negative then g′(a+x) is larger than g′(x). By the mean value theorem, g′′ is positive somewhere between x and a+x. Yet g′′ is never positive, hence h′ is never negative. Again, the mean value theorem tells us h can never get smaller, else h′ would be negative. Thus h(b) is at least as large as h(0), which is 0. Thus g(a)+g(b) ≥ g(a+b), and the triangular inequality holds.

If g is strictly increasing, with g′ = 0 only at isolated points (if ever), Then g is invertible. The set of points that are less than ε distance from a given point p, under the original metric, can also be described as the set of points that are less than g(ε) distance from p, in the new metric. The open balls are the same, and the topology is the same.

If you want to make an unbounded space bounded, set g(x) = x/(1+x), or any other bounded, increasing function.