Is the infinity function continuous? 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. 
 A: 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.
A: You are introducing the set $\bar{\mathbb R}:={\mathbb R}\cup\{-\infty,\infty\}$ as codomain of functions $f:\>{\mathbb R}\to\bar{\mathbb R}$. If you want to discuss continuity of such functions you have to introduce a topology on $\bar{\mathbb R}$. The usual topology is obtained by letting the sets $\ ]M,\infty]$, $M>0$, form a neighborhood base of $\infty$, and similarly for $-\infty$. In this way $\bar{\mathbb R}$ becomes homeomorphic to the interval $[-1,1]$.
Under this setup the function $f(x):=\infty$ is admissible, and is continuous. It is a totally different matter when we are asking whether this function is integrable, even on a finite interval $[a,b]$. Of course this is not the case.
