Consider $f: D(\subseteq \mathbb R) \to \mathbb R$ with $x_0 \in D$ and $(\xi_n) \subset D \setminus \{x_0\}$ where $\displaystyle{\lim_{x \to \infty}\xi_n = x_0}.$
Suppose $f'(x_0) = c.$
Then we can claim that for all $x \in D, \ f(x) = f(x_0) + c(x − x_0) + \varphi(x)$ where $\varphi: D \to \mathbb R$ as $\displaystyle{\lim_{x \to x_0}\frac{\varphi(x)}{x - x_0} = 0}$ and $\varphi$ is continuous at $x_0.$ To see why that's true, consider $\varphi(x) = f(x) - f(x_0) - f'(x_0)(x - x_0)$. Then $\displaystyle{\lim_{x \to x_0}\frac{\varphi(x)}{x - x_0} = \lim_{x \to x_0}\left(\frac{f(x) - f(x_0)}{x - x_0} - f'(x_0)\right) = \lim_{x \to x_0}\left(\frac{f(x) - f(x_0)}{x - x_0}\right) - \lim_{x \to x_0}f'(x_0) = f'(x_0) - f'(x_0) = 0}$.
Since $\varphi(x)$ is continuous at $x_0, \ \displaystyle{\lim_{x \to x_0}\varphi(x) = 0}$ and so $f(x) \approx f(x_0) + c(x − x_0)$ as $x \to x_0.$
Now assume $f(x) \approx f(x_0) + c(x − x_0)$ as $x \to x_0.$ Then $$\frac{f(x) - f(x_0)}{x - x_0} \approx c \\ \implies \frac{f(x) - f(x_0)}{x - x_0} \neq c \\ \implies \frac{f(x) - f(x_0)}{x - x_0} > c \text{ or }\frac{f(x) - f(x_0)}{x - x_0} < c$$
Case 1:
Suppose $\displaystyle{\frac{f(x) - f(x_0)}{x - x_0} > c }$. Then there's some constant $d$ s.t. $\displaystyle{\frac{f(x) - f(x_0)}{x - x_0} = c + d}$ which means $\displaystyle{\frac{f(x) - f(x_0)}{x - x_0} - d = c}$ meaning $c$ exists as it equals some constant value.
Case 2:
Suppose $\displaystyle{\frac{f(x) - f(x_0)}{x - x_0} < c }$. Then there's some constant $e$ s.t. $\displaystyle{\frac{f(x) - f(x_0)}{x - x_0} + e = c}$ which means $c$ exists as it equals some constant value.
Does that proof above make sense? Thanks.