13

Possible Duplicate:
Find a function $f: \mathbb{R} \to \mathbb{R}$ that is continuous at precisely one point?

I want to know some example of a continuous function which is continuous at exactly one point. We know that $f(x)=\frac{1}{x}$ is continuous everywhere except at $x=0$. But i think this in reverse manner but i dont get any example. So please help me out!

Vishal
  • 245

2 Answers2

36

One standard example is the function

$$f(x)=\begin{cases} x,&\text{if }x\in\Bbb Q\\ 0,&\text{if }x\in\Bbb R\setminus\Bbb Q\;. \end{cases}$$

That is, $f(x)=x$ if $x$ is rational, and $f(x)=0$ if $x$ is irrational. This function is continuous only at $x=0$.

Added: The same basic idea can be used to build a function that is continuous at any single specified point. With a little more ingenuity, you can use it to get, for instance, a function that is continuous just at the integers:

$$f(x)=\begin{cases} \sin\pi x,&\text{if }x\in\Bbb Q\\ 0,&\text{if }x\in\Bbb R\setminus\Bbb Q\;. \end{cases}$$

This works because $\sin\pi x=0$ if and only if $x\in\Bbb Z$.

Brian M. Scott
  • 631,399
15

Just take something like the Dirichlet function:

$$f : \mathbb R \ni x \mapsto \begin{cases} x&\text{if}\; x\in \mathbb Q\\0&\text{otherwise}\end{cases}$$

Then $f$ is continuous only at $x=0$.

bodo
  • 1,184
  • 4
    This is not what is commonly called the Dirichlet function, which goes $Dir: x \mapsto \begin{cases} \color{red}{1} \text{ if } x \in \mathbb Q \ 0 \text{ else} \end{cases}$. So your function is $x \cdot Dir(x)$. Still, great example. – Torsten Schoeneberg Feb 25 '22 at 22:07