Proof of limit using $\epsilon$-$\delta$ definitions of limits and continuity If $\lim \limits_{t\to x}\dfrac{g(f(t))-g(f(x))}{f(t)-f(x)}=L$ and $f$ is continuous at $x$ then $\lim \limits_{f(t)\to f(x)}\dfrac{g(f(t))-g(f(x))}{f(t)-f(x)}=L$
I know that the crucial moment here is continuity of $f$. But can anyone show how to prove this strictly using $"\varepsilon-\delta"$?
I would be very grateful for your help.
 A: As stated, the statement is false. Let
$$ f(x) = \left\{\begin{matrix} x &\text{ if }x\in[-1,1]\cap\mathbb{Q} \\ r(x) &\text{ if }x\in[-1,1]\backslash\mathbb{Q} \\ 2-|x| &\text{ otherwise }\end{matrix}\right. $$
where $r(x)$ returns some rational number strictly between $0$ and $x$ for $x\not\in\mathbb{Q}$, and let
$$ g(x) = \left\{\begin{matrix} x &\text{ if }x\in\mathbb{Q} \\ -x &\text{ if }x\not\in\mathbb{Q}\end{matrix}\right. $$
Then $f$ is continuous at $x=0$, and for $|t|\le 1$ we have $f(t)\in\mathbb{Q}$, so $g(f(t)) = f(t)$ for $|t|\le 1$. This implies that
$$ \lim\limits_{t\rightarrow 0}{\frac{g(f(t))-g(f(0))}{f(t)-f(0)}} = \lim\limits_{t\rightarrow x}{\frac{f(t) - 0}{f(t)-0}} = 1.$$
In determining $\lim\limits_{f(t)\rightarrow f(0)}{\frac{g(f(t))-g(f(0))}{f(t)-f(0)}}$, however, we note that there are at least two ways for $f(t)$ to approach $f(0)=0$. One way is for $t\rightarrow 0$, in which case the limit obtained is $1$, as shown above. Another is for $t\rightarrow 2$. In this case, the limit does not exist. This is because the rationality of $f(t)$ depends on the rationality of $t$, and hence $\frac{g(f(t))-g(f(0))}{f(t)-f(0)} = \pm 1$ will switch signs between rational and irrational $t$, and since both rationals and irrationals are dense, it follows that the limit cannot exist.

Now, I'm going to make two further assumptions. First, I assume that $f(t)\ne f(x)$ for all $t\ne x$ in some neighborhood $(x-T,x+T)$. This is so that the first limit makes sense. Second, I assume that $f$ is continuous in a neighborhood of $x$ (and, abusing some notation, we can lower the value of $T$ above so that this neighborhood is also $(x-T,x+T)$).
Let $\epsilon>0$, and let $\delta>0$ satisfy
$$ |t-x|<\delta\implies \left|\frac{g(f(t))-g(f(x))}{f(t)-f(x)}-L\right|<\epsilon.$$
If need be, we can make $\delta < T$ as well. Now, since $(x-\delta,x+\delta)$ is an interval, and $f$ is continuous on this interval, its image is also an interval (by the Intermediate Value Theorem), and since $f$ is locally non-constant, we know this interval is non-trivial (i.e. it has more than one point). We can thus find an open interval around $f(x)$ (call it $(f(x)-\delta',f(x)+\delta')$) which is contained in the image $f((x-\delta,x+\delta))$. I now make the following claim: for all $t$ such that $|f(t)-f(x)|<\delta'$, we have
$$\left|\frac{g(f(t))-g(f(x))}{f(t)-f(x)}-L\right|<\epsilon.$$
To see this, note that if $|f(t)-f(x)|<\delta'$, then there exists $t'$, with $|t'-x|<\delta$, such that $f(t')=f(t)$. This is because $f(t)\in (f(x)-\delta',f(x)+\delta')\subseteq f((x-\delta,x+\delta))$. Since $|t'-x|<\delta$, we have
$$ \epsilon > \left|\frac{g(f(t'))-g(f(x))}{f(t')-f(x)}-L\right| = \left|\frac{g(f(t))-g(f(x))}{f(t)-f(x)}-L\right| $$
as desired.
EDIT: There is a flaw with this proof; see comments below.
A: $\lim \limits_{t\to x}\dfrac{g(f(t))-g(f(x))}{f(t)-f(x)}=L$, $f$ is continuous at $x$. Show that $\lim \limits_{f(t)\to f(x)}\dfrac{g(f(t))-g(f(x))}{f(t)-f(x)}=L$
For any $\epsilon > 0$ there exits a $\delta $ such that whenever $|x - t | < \delta$ we have $| \dfrac{g(f(t))-g(f(x))}{f(t)-f(x)} - L | < \epsilon$. This Given 
And for any $\epsilon > 0$ there exits $\delta > 0$ such that when $|x - t | < \delta $ we have $| f(x) - f(t)| < \epsilon$. This since $f$ is continuous. 
Given $\epsilon > 0$ there exits $\beta >0$ such that when $|x - t | < \beta$ we have $| \dfrac{g(f(t))-g(f(x))}{f(t)-f(x)} - L | < \epsilon$
The idea here is to choose a small $\delta$ such that $t$ satisfy $|f(x) - f(t) | < \delta$ then there exits $\beta'$ with $t$ in  $|x - t | < \beta'< \beta$. It a reverse of the definition.
