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

Let's say we have $f$, $g$ such that $\lim_{x\to a}f(x) = b$ and $\lim_{x\to b} g(x) = c$.

I would like to see an example when $g(f(x))$ does not tend to $c$ as $x \to a$.

A friend of mine suggested the following, but we are curious if we can find something simpler.

$$f(x) = \begin{cases} 0 & x \in \mathbb{Q}\\ \frac{1}{n} & x \in A_n \end{cases}$$

where $A_n = (\mathbb{R}\setminus\mathbb{Q})\cap\left(\frac{-1}{n}, \frac{1}{n}\right)\setminus\left[\frac{-1}{n+1}, \frac{1}{n+1}\right]$ and

$$g(x) = \begin{cases} 1 & x = 0\\ x & \textrm{otherwise} \end{cases}.$$

share|cite|improve this question
up vote 2 down vote accepted

Take $$f(x)=2012\ \forall x\in \mathbb{R}$$ and $$g(x)=\begin{cases}x&\mbox{if, } x\neq 2012\\ 2013&\mbox{if, } x=2012\end{cases}$$ Then $\lim_{x\to 2012}f(x)=2012$, $\lim_{x\to 2012}g(x)=2012$ while $$g(f(x))=2013\ \forall x\in \mathbb{R}$$ and so $\lim_{x\to 2012}g(f(x))=2013$ (I hope you like the choice of numbers)

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.