Throughout, BdXββ(x,r) and BdYββ(w,r) denote open balls, and we use that a subset is open in a metric space exactly when it contains an open ball about each of its points.
Continuity implies that preimages of open sets are open. Assume f is continuous on X, let VβTdYββ, and let xβfβ1(V). Then f(x)βV, and since V is open in (Y,dYβ) there is a real number Ξ΅>0 with BdYββ(f(x),Ξ΅)βV. By continuity of f at x relative to X there is a real number Ξ΄>0 such that every yβX with dXβ(x,y)<Ξ΄ satisfies dYβ(f(y),f(x))<Ξ΅. Let yβBdXββ(x,Ξ΄), so that dXβ(x,y)<Ξ΄. Then dYβ(f(y),f(x))<Ξ΅, and dYβ(f(x),f(y))=dYβ(f(y),f(x)) by condition 3 of the definition of a metric, so f(y)βBdYββ(f(x),Ξ΅)βV and hence yβfβ1(V). Thus BdXββ(x,Ξ΄)βfβ1(V). As x was an arbitrary point of fβ1(V), the set fβ1(V) is open in (X,dXβ), that is, fβ1(V)βTdXββ.
Openness of preimages implies continuity. Assume fβ1(V)βTdXββ for every VβTdYββ. Let xβX and let Ξ΅ be a real number with 0<Ξ΅. The set V=BdYββ(f(x),Ξ΅) is open in (Y,dYβ) by Open Ball in a Metric Space is Open, so VβTdYββ and therefore U=fβ1(V)βTdXββ. By condition 2 of the definition of a metric, dYβ(f(x),f(x))=0, and 0<Ξ΅, so f(x)βV and hence xβU. Since U is open in (X,dXβ) there is a real number Ξ΄>0 with BdXββ(x,Ξ΄)βU. Now let yβX satisfy dXβ(x,y)<Ξ΄. Then yβBdXββ(x,Ξ΄)βU, so f(y)βV, that is, dYβ(f(x),f(y))<Ξ΅; by condition 3 of the definition of a metric, dYβ(f(y),f(x))<Ξ΅. Hence f is continuous at x relative to X, and as xβX was arbitrary, f is continuous on X.