[Math] Function whose limit does not exist at all points

calculuslimitsreal numbers

There are functions which are discontinuous everywhere and there are functions which are not differentiable anywhere, but are there functions with domain $\mathbb{R}$ (or "most" of it) whose limit does not exist at every point? For example, $ f:\mathbb{R}\to\mathbb{N}, f(x) = $ {last digit of the decimal representation of $x$}. Is this even a valid function?

Best Answer

As suggested in the comments define $f:\mathbb{R}\rightarrow \mathbb{R}$ by $f(x)=0$ if $x$ is irrational and $f(x)=1$ if $x$ is rational. Let's prove it doesn't have a limit at any point. Let $y\in \mathbb{R}$, suppose $y$ is irrational and that there exists $L$ the limit of $f$ at $y$. Then given any $\epsilon<1/2$, there is $\delta>0$, such that $x\in (y-\delta, y+\delta)\setminus\{y\}$ implies $|f(x)-L|<1/2$. Now, since there exists $x_0,x_1\in (y-\delta, y+\delta)\setminus\{y\}$ such that $x_0$ is rational and $x_1$ is irrational we get that $1=|1-0|=|f(x_0)-f(x_1)|\leq |f(x_0)-L|+|f(x_1)-L|<1/2+1/2=1$, a contradiction. So the limit at any irrational $y$ does not exists. The same argument applies to any rational $y$, so the limit doesn't exists at every point.