Equivalence of continuity definitions [duplicate]

Solution 1:

(1)$\Rightarrow$(2) Let $f\colon (X,d_X)\to (Y,d_Y)$ be a function of metric spaces such that for every open subset $U$ of $Y$, $f^{-1}(U)$ is open on $X$.

Let $x\in X$, and let $\epsilon\gt 0$. We want to show that there exists $\delta\gt 0$ such that $d_X(a,x)\lt \delta$ implies $d_Y(f(a),f(x))\lt \epsilon$. Think about the open set $$B(f(x),\epsilon) = \{y\in y\mid d_Y(y,f(x))\lt\epsilon\}$$ and about the definition of "open set" in $(X,d_X)$.

(2)$\Rightarrow$(1). Let $f\colon (X,d_X)\to (Y,d_Y)$ be a function of metric spaces such that for every $x\in X$ and every $\epsilon\gt 0$ there exists $\delta\gt 0$ such that if $d_X(a,x)\lt \delta$, then $d_Y(f(a),f(x))\lt\epsilon$. We need to show that if $U$ is an open subset of $Y$, then $f^{-1}(U)$ is an open subset of $X$.

Let $U$ be an open subset of $Y$, and let $x\in f^{-1}(U)$. Since $f(x)\in U$ and $U$ is open, there is an open ball $B(f(x),\epsilon)$, $\epsilon\gt 0$, such that $B(f(x),\epsilon)\subseteq U$. Then...