I was working on Abbott's Understanding Analysis 2nd edition exercise 4.3.4 and would be very happy if someone could check my solution.
The exercise:
Assume $f$ and $g$ are defined on all of $\mathbb{R}$ and that $\lim_{x \rightarrow p } f(x) = q$ and $\lim_{x \rightarrow q } g(x) = r$.
a) Give an example to show that it may not be true that $$ \lim_{x \rightarrow p } g(f(x)) = r $$ b) Show that the result in a) does follow if we assume f and g are continuous
c) Does the result in a) hold if we only assume f is continuous? How about if we only assume that g is continuous?
My Solution:
a) So my idea here was to use that the definition of the limit at a point $c \in \mathbb{R}$ is not depending on the function value at $c$. So we can set $$ g(x) = \begin{cases} -1 &\mbox{if } x = 0 \\ 0 & \mbox{else } \end{cases}. $$ And for $f$ we chose f(x) = 0. Then $\lim_{x \rightarrow 0 } g(x) = 0$ and $\lim_{x \rightarrow 0 } f(x) = 0$ but: $$\lim_{x \rightarrow 0 } g(f(x)) = \lim_{x \rightarrow 0 } g(0) = g(0) = -1.$$
c) So let's first talk about this part. Obviously, the function $f$ I used in part a) is continuous but $g$ is not. I tried to come up with a counterexample for continuous $g$ and discontinuous $f$, however, I could not find one so I tried to prove that indeed the continuity of $g$ is enough to proof part b).
b) As $g$ is continuous it holds that: $$ r = \lim_{x \rightarrow q } g(x) = g( \lim_{x \rightarrow q } x ) = g(q).$$ Now let $(x_n)_{n \in \mathbb{N}}$ be an arbitrary sequence s.t. $\lim_{n \rightarrow \infty } x_n = p$ and $x_n \neq p \ \ \forall n \in \mathbb{N}$. Using the sequential definition of functional limits and the fact that $\lim_{x \rightarrow p } f(x) = q$, we see that $\lim_{n \rightarrow \infty } f(x_n) = q$. But then we can directly use the continuity of $g$ to see that: $$ \lim_{n \rightarrow \infty } g(f(x_n)) = g(\lim_{n \rightarrow \infty } f(x_n)) = g(q) = r.$$ It follows that $$ \lim_{x \rightarrow p } g(f(x)) = r .$$
Cheers, Max