Define the function $f: \mathbb{R} \to \mathbb{R}\cup\{\infty\}$ as $f(x) = \infty$ for all $x \in \mathbb{R}$.
Is this function continuous?
Intuitively it seems like it is, but I cannot prove this function is continuous in the usual $\varepsilon-\delta$ way because the difference $|f(x)-f(y)|$ is undefined for all $x,y \in \mathbb{R}$.
This problem came up when I was trying to determine if a continuous function $g: \mathbb{R} \to \mathbb{R}\cup\{-\infty\}\cup\{\infty\}$ must be finite a.e. Any insight is appreciated.
It is indeed continuous, no matter what topology we put on either space: any constant map between two topological spaces is always continuous.
Recall that in the context of topology, a map $f:X\rightarrow Y$ is continuous if $f^{-1}(U)$ is open in $X$ whenever $U$ is open in $Y$. Well, in any topological space, both $\emptyset$ and the whole space are open by definition. Now if $f: X\rightarrow Y$ is constant, then the preimage of any set, open in $Y$ or not, is either $\emptyset$ or $X$; so $f$ is continuous.
It is true that the usual metric on $\mathbb{R}$ leaves the topology on $\mathbb{R}\cup\{\infty\}$ ambiguous. One "natural" choice is to use the topology generated by $$\{(a, b): a,b\in\mathbb{R}\}\cup\{(a, \infty]: a\in\mathbb{R}\},$$ but it would also be consistent to take $\{\infty\}$ open, or many weirder choices as well. (By "consistent" I mean that the resulting topology yields the standard topology on the subspace $\mathbb{R}$.) So in that sense, there are really two components of your question:
Does the usual metric on $\mathbb{R}$ determine the topology of $\mathbb{R}\cup\{\infty\}$? The answer to this is no.
Despite that, can we still tell whether the map $x\mapsto \infty$ is continuous? The answer to this is yes: regardless of what topology we put on $\mathbb{R}$ and $\mathbb{R}\cup\{\infty\}$, every constant map is continuous.