25

Is the function $f(x) = \lim_{k \to +\infty} \tan{kx}$ a right example?

But I do not know whether this is a function at first. Is this a function?

Could you give a correct real-valued function that is continuous at precisely one point?

Thanks.

Jichao
  • 8,182
  • 2
    Your example is a function that's only defined at a single point, $x=0$; the limit doesn't exist for any other $x$. – joriki Aug 27 '11 at 07:27

3 Answers3

56

The function $$f(x)=\begin{cases}x\text{ if }x\in\mathbb{Q}\\0\text{ if }x\notin\mathbb{Q}\end{cases}$$ is continuous at $x=0$ but nowhere else.

Zev Chonoles
  • 132,937
  • 12
    More generally, if $\phi(x)$ is any bounded and nowhere continuous function, let $f(x) = x \phi(x)$. – Nate Eldredge Aug 27 '11 at 14:15
  • 2
    Why is the above example (given by Zev) continuous at zero? – Kara Apr 11 '13 at 21:45
  • 3
    @Kara: Let $x_n$ be any sequence converging to zero, then $f(x_n)$ is also a sequence converging to zero. – Asaf Karagila Apr 11 '13 at 21:47
  • 1
    @Kara because $-|x| \leq f(x) \leq |x|$ for all $x$. – N. S. Apr 11 '13 at 21:55
  • 3
    @Kara: The definition of "preimage of open set is open" is for continuity everywhere, not for continuity at a point. In metric spaces we have simpler ways to verify continuity. – Asaf Karagila Apr 11 '13 at 22:07
  • 1
    Also $f(x) = x$ for rational $x$, otherwise $f(x) = -x$ is 1-1 and onto, but continuous only at $x=0$. – hardmath Apr 11 '13 at 22:23
  • 1
    What about the function f(x) = {0 if x is rational, x if x is irrational}? Is this continuous at x = 0 and nowhere else? – Kara Jul 31 '13 at 00:33
  • Dear Zev! Thanks for an answer. I guess that we can modify this example a bit. Take a specific $x_0\in \mathbb{R}$ and define $f:\mathbb{R}\to \mathbb{R}$ by $f(x)=x-x_0$ if $x\in \mathbb{Q}$ and $f(x)=0$ for $x\notin \mathbb{Q}$. Then one can show that $f$ is continuous ONLY at $x_0$. – RFZ Sep 20 '19 at 13:25
  • Nice example. I think it will be even better for readers to consume the idea if we point out the lemmas: between any two real numbers, there exists at least one rational number, and one irrational number, hence infinitely many. Then we can use the classic $\epsilon$ and $\delta$ argument: if $x=0$, then for any $\epsilon$, we just make $\delta=\epsilon$, in the interval $(-\delta,\delta)$, irrational number is 0 that trivially satisfies. For other $x$, we consider several cases: $x$ is rational, and $x$ is irrational. If $x$ is rational, we give a counter-example of a irrational number, etc. – Dachuan Huang Jun 26 '21 at 20:49
23

Your example isn't going to work because it actually isn't defined for any nonzero $x$. If $x$ is nonzero, then $kx$ gets either positively or negatively infinite as $k \to \infty$, and $\tan kx$ is going to zoom around periodically and so will not have a limit.

The standard example of a function continuous at only 1 point is something like the one given by Zev Chonoles, where $f$ takes the value of some continuous function (in this case, $f(x)=x$) on a dense subset of the reals that has a dense complement (in this case, $\mathbb{Q}$), and another continuous function (in this case, $f(x)=0$) on the complement. If the two functions coincide at exactly one point, then you get continuity at that point; everywhere else, the function bounces around crazily between the two continuous functions it is cobbled together from, because it takes each one's value on a dense subset of $\mathbb{R}$.

0

Your example is an expression that defines a function, but the domain of said function is not the real line, unless you allow extended real numbers as the output; but, by the criteria of your problem statement, you do not allow that.If you use the extended real line as a codomain, then the formula that you gave describes a function that maps the entire real line onto the three point set $\{-\infty,0,\infty\}$. In this case, the function would be continuous at every real number except $0$.

However, at the outset, your problem statement requires that the codomain and range both be the real line. This is incompatible with the above discussion, because the real line includes neither $\infty$ nor $-\infty$.