Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

For a function defined as follows:

$f(x) = \begin{cases} 1 & \text{if $x$ is rational} \\ e^x & \text{if $x$ is irrational} \\ \end{cases}$

How does one figure out the points at which f is continuous? Is there some kind of heuristic to figuring this out intuitively?

To be honest I was a little taken aback by the definition of the function. Naively I thought the function is likely continuous at $0$ since that's when the $e^x$ and $1$ become equal. Are there any other points?

share|cite|improve this question
Heuristic: Draw a picture of $x\mapsto 1$, and $x \mapsto e^x$ and see where they cross. This is the only place they have a chance of being continuous. In fact, for any applicable problem, my first advice would be to draw a picture (but then again, I am an engineer). – copper.hat Nov 8 '12 at 17:30
Do you know what "continuous" means? – Chris Eagle Nov 8 '12 at 17:30
up vote 2 down vote accepted

Let $a$ be any real number. There is always a sequence $\langle q_n:n\in\Bbb N\rangle$ of rational numbers converging to $a$, and along this sequence you have $\langle f(q_n):n\in\Bbb N\rangle\to 1$, since all of the $f(q_n)$ are equal to $1$. There is also always a sequence $\langle x_n:n\in\Bbb N\rangle$ of irrational numbers converging to $a$, and along this sequence you have $\langle f(x_n):n\in\Bbb N\rangle=\langle e^{x_n}:n\in\Bbb N\rangle\to e^a$. In order for $f$ to be continuous at $a$, these two limits must be the same. What does that tell you about $a$?

share|cite|improve this answer

The two functions $f_1(x)= 1$ and $f_2(x)=e^x$ for themselves would be continuous. Then the function obtained by "mixing" them like in this problem is continuous exactly at those points $x$ where $f_1(x)=f_2(x)$ holds.

To see this, consider $x_0$ with $f_1(x_0)\ne f_2(x_0)$. Let $\epsilon = \frac12 |f_1(x_0)-f_2(x_0)|$. If $x_0$ is rational, you find irrational points $x$ arbitrarily close to $x_0$ such that $|f_2(x)-f_2(x_0)|<\epsilon$, hence $|f(x)-f(x_0)|=|f_2(x)-f_1(x_0)|\ge |f_2(x_0)-f_1(x_0)|-|f_2(x)-f_2(x_0)|=\epsilon$, i.e. $f$ is not continuous at $x_0$. The sam works with rational and irrational interchanged if $x_0$ is irrational.

On the other hand, if $f_1(x_0)=f_2(x_0)$, then for any $\epsilon>0$ there exists $\delta_1>0$ with $|f_1(x)-f_1(x_0)|<\epsilon$ if $|x-x_0|<\delta_1$ and $\delta_2>0$ with $|f_2(x)-f_2(x_0)|<\epsilon$ if $|x-x_0|<\delta_2$. Then with $\delta:=\min\{\delta_1,\delta_2\}$ we have $|f(x)-f(x_0)|<\epsilon$ if $|x-x_0|<\delta$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.