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}.$