I'm new to this all concept of O-notation and be glad if you could help me with understanding the following proof:
Calculate : $$\frac{f(x) + O(|x-x_0|))}{f(x) + O(|x-x_0|)}$$ Where $f(x)$ is continuous and $f(x_0) \ne 0$.
The author does the following:
Denoting $\delta = |x-x_0|$ (it should be possible as far as I understand)
$$\frac{f(x)}{f(x)+O(|\delta|)} \simeq \frac{f(x)}{f(x)+c\delta} \simeq \frac{f(x) + c\delta - c\delta}{f(x)+c\delta} = 1 - \frac{c\delta}{f(x)+c\delta} \color{red}{=} 1 + O(\delta) $$
$$\frac{O(\delta)}{f(x)+O(\delta)} \stackrel{\text{by continuity }}{\simeq} \frac{O(\delta)}{k+O(\delta)} \color{green}{\simeq} O(\delta)$$
I marked with colors two equation I don't quite understand and be glad for explanation.
Thanks!
Let's start with $$\frac{O(\delta)}{k+O(\delta)} \simeq O(\delta).$$
The idea here is that $\frac{1}{k+O(\lvert x-x_0\rvert)}$ acts like a constant factor, that is, $$\frac{O(\delta)}{k+O(\delta)} = \frac{1}{k+O(\delta)} O(\delta) \simeq k_1 O(\delta) \simeq O(\delta).$$
In particular, for any function $g(\delta)$ in $O(\delta)$, since $k\neq0$ you can find a neighborhood of $x_0$ in which $\left\lvert g(\delta)\right\rvert = \left\lvert g(\lvert x-x_0\rvert)\right\rvert < \frac12 \lvert k\rvert,$ so that $\left\lvert k+g(\delta)\right\rvert > \frac12 \lvert k\rvert$ and therefore $\left\lvert\frac{1}{k+g(\delta)}\right\rvert < \frac2{\lvert k\rvert}.$ Multiply any $O(\delta)$ function by this and you have a $O(\delta)$ function, though possibly with a new constant factor.
For the other equation, note that $$ \frac{c\delta}{f(x)+c\delta} \simeq \frac{O(\delta)}{k+O(\delta)} \simeq O(\delta).$$
Technically, I think we could therefore write $$1 - \frac{c\delta}{f(x)+c\delta} \simeq 1 - O(\delta),$$ in which $1 - O(\delta)$ is a class of functions of the form $1 - h(\delta)$ where $h(\delta)$ is in $O(\delta)$. But since $h(\delta)$ could be positive or negative for any particular value of $\delta,$ and since $-h(\delta)$ is in $O(\delta)$ whenever $h(\delta)$ is in $O(\delta),$ it follows that $1 - O(\delta) \simeq 1 + O(\delta).$ Moreover, by convention, I don't think anyone writes $1 - O(\delta)$ when they could write $1 + O(\delta)$ instead.