In my real analysis textbook, they present the proof of L'Hopital's by using Cauchy's mean value theorem. The part in the proof I am struggling to work out rigorously is a particular implication involving equivalent limits using different variables.
We have assumed that $f(c)=g(c)=0$, $f$ and $g$ are differentiable on a neighbourhood of $c$, and that the limit $\lim_{x \to c} \frac{f'(x)}{g'(x)} = l$. In the proof we consider a neighbourhood of $c$, and we already know $f$ and $g$ are differentiable on the neighbourhood. We define $y$ to be a specific point such that $y > c$. Then $f$ and $g$ satisfy Cauchy's Mean Value Theorem on $[c,y]$.
We then know that $$\frac{f'(z)}{g'(z)} = \frac{f(y)-f(c)}{g(y)-g(c)} = \frac{f(y)}{g(y)}$$
So now we let $y \to c^+$ and it follows that $z \to c^+$.
By simply renaming the domain variable, we know that $$\lim_{z \to c^+} \frac{f'(z)}{g'(z)} = l$$
My book then says: It follows that $$\lim_{y \to c^+} \frac{f(y)}{g(y)} = l$$
This step is intuitively obvious to me; and my reasoning is that by the way we have defined $y$ and $c$, the expressions $\frac{f'(z)}{g'(z)}$ and $\frac{f(y)}{g(y)}$ are exactly equal for any corresponding values of $y$ and $c$, and thus the sequences defined by these two expressions are exactly equal. Thus the limits are obviously equal. Is this reasoning correct?
I also wanted to clarify how, if it is possible, I can take the limits of both the rhs and lhs of an equation when they are expressed using different variables? For example, if we have $f(x) = g(x)$, then I can simply say $\lim_{x \to c} f(x) = \lim_{x \to c} g(x) = m$. This is easy since there is only one domain variable. But in my particular case, how could I simultaneously take the limits of both sides of $\frac{f'(z)}{g'(z)} = \frac{f(y)}{g(y)}$? Is this even possible?
The only justification I can think of is the one I described above, where I deduce that the two sequences must be the same for the particular limits I have chosen, and thus must have equal limits. In other words, I don't know a general method for taking the limit of equivalent expressions of different variables?
Those variables are different but not independent. We are taking limit of equation as a single variable $y\to c^+$. This forces $z\to c^+$ and the LHS to tend to $l$. By the nature of equality RHS also does the same.
You can use a typical $\epsilon, \delta$ to add more rigor if you wish. Thus let $\epsilon>0$ be given then we know that there is a $\delta>0$ such that $$0<|x-c|<\delta\implies |f'(x) /g'(x) - l|<\epsilon\tag{1}$$ Let $y$ be any number such that $0<y-c<\delta $. Then we have a $z$ with $c<z<y$ such that $$\frac{f'(z)} {g'(z)} =\frac {f(y)} {g(y)} $$ Now $c<z<y$ implies that $0<z-c<y-c<\delta$ and hence we automatically get from $(1)$ $$\left|\frac{f'(z)} {g'(z)} - l\right|<\epsilon $$ and therefore $$\left|\frac{f(y)} {g(y)} - l\right|<\epsilon $$ and the proof is complete.
Now consider the alternative scenario. Suppose the hypotheses are changed and you are given that $f(x) /g(x) \to l$ as $x\to c$. In this case we can't conclude that $f'(x) /g'(x) \to l$. Things change when we try to take limit of equation $$\frac{f'(z)} {g'(z)} =\frac{f(y) } {g(y)} $$ as $y\to c^{+} $. The variable $z\to c^{+} $ and RHS tends to $l$ so does LHS. But we don't get the result $f'/g'\to l$. Why???
Because our entire argument uses the fact that for every $y$ there is some $z$ in $c<z<y$ for which the equation holds. Thus we can say safely that that there is some sequence of values $z_n$ with $z_n>c$ and $z_n\to c$ such that $f'(z_n) /g'(z_n) \to l$ but this does not work for all such sequences and hence $f'/g'$ may not necessarily tend to $l$.
The case of L'Hospital's Rule is different. Here we are given that for all sequences $z_n$ with $z_n\neq c, z_n\to c$ we have $f'(z_n) /g'(z_n) \to l$. And for all sequences $y_n$ with $y_n\neq c,y_n\to c$ we have some sequence $z_n$ with $z_n\neq c, z_n\to c$ such that $$\frac{f(y_n)} {g(y_n)} =\frac{f'(z_n)} {g'(z_n)} $$ It is known that RHS tends to $l$ and hence LHS tends to $l$ for all sequences $y_n$.
The key point is that there is an inherent difference between nature of $y$ and $z$ in your equation. We can find some $z$ for every $y$ which makes the equation true but we don't know if for every $z$ we can find a corresponding $y$. If that happens to be the case for some specific functions $f, g$ then L'Hospital's Rule will also work in reverse for those functions (if ratio of functions tends to a limit, then ratio of their derivatives tends to the same limit).