Composition of limits

Find functions $f,g : \mathbb R \longrightarrow \mathbb R $ and $a,b,c \in \mathbb R $ such that

$$ \lim_{x \rightarrow a} f(x) = b \quad \text{and} \quad \lim_{y \rightarrow b} g(y) = c \quad \text{but}\quad \lim_{x \rightarrow a} g(f(x)) \neq c$$

I tried to use non continous functions but i didnt manage to get a any useful results.


Solution 1:

Take

$f(x)=1 $ if $x\neq 0$ and $f(0)=0$

then $\lim_{x\to 0}f(x)=1.$

$g(x)=2$ if $x\neq 1$ and $g(1)=3$

then $\lim_{x\to 1}g(x)=2.$

but

$g(f(x))=3$ if $x\neq 0$ and $g(f(0))=g(0)=2$

thus $\lim_{x\to 0}g(f(x))=3\neq 2$.

Solution 2:

You can find counter-example very easily when you understand the rule of composition of limits:

Rule of Composition of Limits: If $\lim_{x \to a}f(x) = b,\lim_{x \to b}g(x) = c$ and $f(x) \neq b$ as $x \to a$ then $\lim_{x \to a}g(f(x)) = c$.

The condition $f(x) \neq b$ as $x \to a$ is generally overlooked but it is the crux of the above rule. A counter-example is easily obtained when one ignores this condition. For example we can choose $f(x) = b$ for all $x \neq a$ and then have $g$ as a function which has a problem at $x = b$ but is otherwise fine near $x = b$.