# If limit exists, is that function continuous?

If I have a function $$f$$, and the limit exists at $$a$$, and $$\lim\limits_{x \to a} f(x) = \infty$$ or $$\lim\limits_{x \to a} f(x) = k$$, where $$k$$ is a constant, does that mean that the function is continuous on some interval in the domain of $$f$$?

I think this is true, but I am not sure. Because for example, if $$\lim\limits_{x \to a} f(x) = \infty$$, if I graph a function that fulfills this, there is at least some interval in its domain where it is continuous.

• Depends on what $f(a)$ is. The limit existing is not enough for continuity. (You can generalize functions to allow $f(a)=\infty,$ but that usually isn’t allow. For real-valued functions, there is no way for $f$ to be continuous at $a$ if the limit doesn’t exist or is $\pm\infty.$ But if the limit is $k,$ it is continuous iff $k=f(a).$) Oct 24 at 2:08

The existence of a limit does not imply that the function is continuous somewhere. Some counterexamples: $$\text{Let }f_1(x) = \begin{cases} 0&x=0\\ \frac1{x^2}&x\in\mathbb{Q}\backslash\{0\}\\ \frac1{2x^2}&x\notin\mathbb{Q} \end{cases}$$
$$\text{and let }f_2(x) = \begin{cases} 1&x=0\\ x&x\in\mathbb{Q}\backslash\{0\}\\ -x&x\notin\mathbb{Q}\end{cases}$$ Here, we can see that $$\lim\limits_{x\to0}f_1(x)=\infty$$ and $$\lim\limits_{x\to0}f_2(x)=0$$, but $$f_1$$ and $$f_2$$ are nowhere continuous.
Let $$f(x) = \begin{cases} x \quad{} &\text{if x \ne 0 and x is rational}\\ 0 &\text{if x is irrational} \\ 1 & \text{if x = 0}\end{cases}.$$ You can see that $$\lim_{x \to 0} f(x) = 0$$, but $$f$$ is continuous nowhere.