Does continuity depend on the distance function?

Yes. Example: Take the metric where $d(x,x) = 0$ and $d(x,y)=1$ for $x\neq y$ and the Euclid metric. In the first one all functions are continuous and in the second you can find non-continuous functions


Yes, it does depend on the metric but indirectly.

On a metric space like $(X,d)$ and $(Y,d')$ one defines the topology $\mathcal{T}_d$ or $\mathcal{T}_{d'}$ induced by the metric. This is the smallest topology such that all "open balls" $B(x,r) = \{y \in X: d(x,y) < r\}$ (where $x \in X, r>0$) of the metric are open.

Continuity of $f: (X,d) \to (Y,d')$ depends only on $\mathcal{T}_d$ and $\mathcal{T}_{d'}$; it is a purely topological notion. But we can prove that your criterion is just a reformulation of "$f$ is $(\mathcal{T}_d,\mathcal{T}_{d'})$-continuous at $a$" in terms of the metric that defined the topology.

There are situations where choosing a different metric $d''$ on $X$ will give the same topology so $\mathcal{T}_d = \mathcal{T}_{d''}$, or similarly on $Y$. In that case the metrics are called equivalent. In that case the continuity is not affected by changing the metric.

But if $d$ is the standard metric on $\mathbb{R}$, so $d(x,y) = |x-y|$, and we define another metric $d'(x,y) = |x| + |y|$ (if $x \neq y$ and $d'(x,y) = 0$ otherwise), it turns out that continuity of any function on $(\mathbb{R},d)$ at $0$ is not affected by changing the metric from $d$ to $d'$ (keeping the codomain the same), but at all other points $p \neq 0$ any such function $f$ is always continuous at $p$ in the $d'$ metric. The topologies $d$ and $d'$ are non-equivalent on $\mathbb{R}$: in $d$, $\{1\}$ is not open but in $d'$ it is.


Absolutely it is possible. If you put the discrete metric on $X$ (i.e. the metric defined by $d(x,y) = 1$ when $x \neq y$ and $d(x,x) = 0$) then any function $f:X \to Y$ is continuous because any set in $X$ is open. Thus, for exampl, we can take any function $f:\mathbb R \to \mathbb R$ which is discontinuous with the standard metric on $\mathbb R$ and it will become continuous if we replace the metric on the source space by the discrete metric.