# Understanding continuity in metric spaces

Let $(X, d)$ and $(Y, \rho$) be metric spaces. A function $f: X \rightarrow Y$ is continuous at a point $x_0 \in X$ if $\forall \varepsilon >0 \exists \delta >0$ such that $d(x, x_0) < \delta \implies \rho(f(x), f(x_0)) < \varepsilon$.

I understand that the above definition of continuity in metric spaces is a very intuitive extension of the $\epsilon-\delta$ version. However, what I don't understand is that the above definition depends on what metric we are using in each metric space right? For example, say I have a function $f: X \rightarrow \mathbb{R}$ and we want to see whether it is continuous or not, do we need to first specify a metric for $\mathbb{R}$? Or can $\rho$ be ANY metric, so we can take it to be just the standard $| \cdot|$ metric?

That is, is it possible for a function to be continuous based on particular choices of $d$ and $\rho$ but fail to be continuous if we change one of the metrics?

The answer is: “yes, of course it deponds on the metric”. Fir instance, consider $f\colon\mathbb{R}\longrightarrow\mathbb{Z}$ defined by $f(x)=\lfloor x\rfloor$; that is, $f$ is the floor function. In $\mathbb Z$ and in $\mathbb R$ consider the usual metrics. Then the function $f$ is discontinuous. But if, in $\mathbb R$, you consider the discrete mtric, that is, the metric $d$ defined by$$d(x,y)=\begin{cases}1&\text{ if }x\neq y\\0&\text{ otherwise,}\end{cases}$$then $f$ becomes a continuous function.

If the metrics generate the same topologies, then the set of continuous functions is exactly the same. Changing to different but equivalent (in the above sense) metrics may mean that your choice of $\delta$ for a given$f$, $x$, and $\epsilon$ may change, but it will still exist.

But if at least one of the generated topologies differs from the original pair of topologies, then the set of continuous functions will differ.

One of the stock examples is the following. Given a metric space $(X,d)$, define the corresponding bounded metric to be $\bar{d}(x,y)=\min\{d(x,y),1\}$. Then $(X,d)$ and $(X,\bar{d})$ have the same open sets.

The point of this example is the the essential germ of the metric is "local", in the sense that the topology is completely determined "in the small"; it doesn't matter what is "far" from a given point, only what is sufficiently "close" to it.

I have a function $f: X \rightarrow \mathbb{R}$ and we want to see whether it is continuous or not, do we need to first specify a metric for $\mathbb{R}$?

Actually yes.

Very often in literature something like "if no special metric is given we use the euclidean" is written.

That is, is it possible for a function to be continuous based on particular choices of $d$ and $\rho$ but fail to be continuous if we change one of the metrics?

Take the discrete metric, then each function $f$ is continous w.r.t to that metric.

Let me start more generally, then I'll specialise to your case.

Continuity is a topological property. That means that it depends uniquely on the topology you put on the (topological) space; indeed, the most general definition of continuity between topological spaces is the following: a map $f:X\longrightarrow Y$ between topological spaces is continuous is and only if for every open set $V\subseteq Y$ the set $f^{-1}(V)$ is open in $X$.

You will be puzzled by this definition, however, if you don't know general topology yet. But this definition specialises exactly to yours in the case $X,Y$ are metric spaces, where the topologies are "naturally induced by the metric".

In other words, when you have a metric space $(X,d_X)$, there is a natural topology on $X$, whose open sets are $X$, the empty set and the balls $$B(x,\rho):=\{y\in X\mid d_X(x,y)<\rho\}$$

You can try to rewrite the above abstract definition of continuity for metric spaces, and it will turn out exactly as you imagine.

Now the point is, if you change $d_X$, you are changing the balls unavoidably, so also the topology will be different. This will result in a different notion of continuity. And of course a map which is continuous with respect to some topology may fail to be continuous if we change topology. You may have encountered the awkward definition of equivalent metrics. That definition assures you that continuity doesn't change upon replacing one metric with the other, and the reason is that the topologies induced are equivalent.

For example, try to see if the identity map $X\longrightarrow X$ remains continuous if you put on the discrete metric in the second $X$ ($d(x,x)=0$ and $d(x,y)=1$ if $x\neq y$) and any other non trivial metric in the first one.