I have been trying to understand why this is true:
$$f'(x)=\lim_\limits{h \to 0}\frac{f(x+h)−f(x)}{h}=\lim_\limits{h \to 0}\frac{f(x-h)−f(x)}{-h}$$
While I understand the intuition, I do not understand the formal basis for it. Every resource I have consulted points to an argument similar to the one found here (Formal basis for variable substitution in limits) as the justification. However, a problem occurs when I attempt to justify the result using this argument:
Let $p(y)=\frac{f(x+y)-f(x)}{y}$ and $g(h)=-h$
Then we have
$\lim_\limits{h \to 0}g(h)=0$ and $\lim_\limits{y \to 0}p(y)=f'(x)$
If $p(y)$ is continuous at zero, then I can use the substitution theorem mentioned above to conclude that: $$\lim_\limits{h \to 0}p(g(h))=\lim_\limits{y \to 0}p(y)$$ so $$\lim_\limits{h \to 0}\frac{f(x-h)−f(x)}{-h}=\lim_\limits{y \to 0}\frac{f(x+y)-f(x)}{y}=f'(x)$$
And now the problem: how do I know $p(y)$ continuous at $y=0$? It appears I am dividing by zero, creating a removable discontinuity. Is it assumed that $p(0)=f'(x)$ and thus, because $\lim_\limits{y \to 0}p(y)=f'(x)$, $p(y)$ is continuous at $p(0)$?
This seems like the most likely option, but I just want to make sure I am not making a mistake somewhere!
Edit:
After quite a bit more work, I believe I have cleared up my confusion. Figured I would follow up here for anyone who walks in my footsteps.
The overall question here is related to an intuition about limits. Consider the case $\lim_\limits{x \to a}f(g(x))$ where we assume $g(x)$ has a limit as $x\to a$. It seems reasonable to conclude that we can analyze the limit from "the inside to the outside". In other words, as $x\to a$, g(x) will get close to some value $L$. Thus, to figure out what happens to $f(g(x))$ as $x\to a$, we simply need to understand how $f(y)$ behaves as $y\to L$. Under what conditions does this logic hold? Two theorems provide the answer.
The first is the one most commonly used and found in entry level textbooks. It is as follows:
Let $f$ be continuous at $L$. Then if $\lim_\limits{x \to a}g(x)=L$ we can conclude that $\lim_\limits{x \to a}f(g(x))=\lim_\limits{y \to L}f(y)=f(L)$
The intuition behind this result is that as $g(x)$ gets close to L, we know $f(x)$ is going to stay close to $f(L)$ because it is continuous. But what can we say when $f$ is not continuous at $L$? This leads us to a more general theorem, which is mentioned here and it turns out in the original post as well:
Let $\lim_\limits{ x \to a}g(x)=L$ and $\lim_\limits{ y \to L}f(y)=M$. Then, if there exists a neighborhood of $a$ such that $g(x)$ does not take on the value $L$, except possibly at $a$, we can conclude that $$\lim_\limits{x \to a}f(g(x))=\lim_\limits{y \to L}f(y)=M$$
Of course, the condition on the neighborhood of $a$ is usually satisfied, so I believe these considerations are usually swept under the rug when doing variable substitutions in limits. I found a slightly more practical version of the theorem here. Roughly, it leads to the same conclusion but assumes that $g(x)$ is continuous and non-constant on an inteval containing $a$, things which are usually the case for common substitutions.
Now, lets link this back to the original question! Clearly $g(h)=-h$ does not take on the value zero in any neighborhood of zero. Thus by the above theorem, the substitution is valid!
The careful reader may notice that I misinterpreted the theorem linked in the original post. As I understand it now, continuity of $f(y)$ at $L$ is only required in the case that every neighborhood of $L$ contains a point $x$ such that g(x)=L