If $f$ and $g$ are two functions of $x$ such that $f$ is differentiable with respect to $x$ at $h$, $g$ is continuous, and $h=g(a)$ for some $a$, then $f$ is differentiable with respect to $g$.
Proof:
We are given that $$\lim _{x\rightarrow h} \frac{f(x)-f(h)}{x-h}=T$$ and $$\lim _{x\rightarrow a} g(x)=g(a)$$
Through this we can infer that for every $\varepsilon$ there exists a $\delta$ such that $|\frac{f(x)-f(h)}{x-h}-T|<\varepsilon$ when $0<|x−h|<\delta$
Now we replace $x$ by $g(x)$ to get $\displaystyle \left|\frac{f(g(x))-f(g(a))}{g(x)-g(a)}-T\right|<\varepsilon$ when $0<|g(x)−g(a)|<\delta$
This implies that $$\lim _{g(x)\rightarrow g(a)} \frac{f(g(x))-f(g(a))}{g(x)-g(a)}=T$$
Now this is obviously untrue, but I can't seem to find where exactly I went wrong. I would really appreciate if someone could explain which step was incorrect.
The statement "$f $is differentiable with respect to $g$" does not make sense because $ g$ is a function not an independent variable.
Also you are dividing by $ g(x)-g(a)$ which is not allowed unless it is not zero.