1

My professor asked me to give an example of a function $f$ defined on real numbers such that $f$ has a limit at $x=5$ only. Could any one help me to find that example.

1 Answers1

3

How about

$$f(x) = \begin{cases} |x-5|, & \text{if $x$ is rational} \\ 0, & \text{if $x$ is irrational} \end{cases}$$

Any interval around any real value $x$ contains both rational and irrational numbers. If $x\ne 5$, the first case in my definition is non-zero and greater than a given value (such as $\frac{|x-5|}2$) in a sufficiently small interval around $x$.

So, if $x\ne 5$, any interval contains points (irrational ones) for which $f(x)$ is zero, and other points (rational ones) that are away from zero. So $f(x)$ does not exist there.

However, at $x=5$, the limit of $f(x)$ for rational numbers is zero, as well as for the irrational numbers. Therefore the limit of $f(x)$ exists there and is zero.

I tried to keep this explanation clear and informal, but a formal proof should be easy given all this.

Rory Daulton
  • 32,888
  • 6
  • 47
  • 64