I am learning big-oh notation and i am wondering if something like $O(\sqrt{x})=O(O(\sqrt{x}))$ is true, and, more importantly, how you can prove this rigorously using the definition of big-oh? Another example is $O(\frac{2x-3}{\log x})=(2x-3)O(\frac{1}{\log x})$.
Thanks
$f(x)=O(g(x))$ means that $f(x)/g(x)$ is bounded, that is, $|f(x)| \leq c g(x)$ for some constant $c$ and for all $x$ in the domain of both $f$ and $g$. To see through the double $O$ notation, just let $O(\sqrt{x})=g(x)$. Then $f(x)=O(g(x))$, which makes sense. Then $|g(x)|\leq c_2 \sqrt{x}$ for some constant $c_2$. So $$|f(x)|\leq c_1 |g(x)| \leq c_1c_2 \sqrt{x}=c\sqrt{x}.$$ So $O(\sqrt{x})=O(O\sqrt{x}))$. Double $O$ notation in effect is saying "something that is bounded by a constant times some function is bounded by a constant times a constant times the same function". But a constant times a constant is just another constant, of course.
Yes, you can pull $(2x-3)$ inside the $O$-notation: $$f(x)=O\left( \frac{2x-3}{\log x}\right) \Leftrightarrow |f(x)| \leq c_1 \frac{2x-3}{\log x} = (2x-3) c_1 \frac{1}{\log x}$$ and $$f(x) = (2x-3) O \left( \frac{1}{\log x}\right) \Leftrightarrow |f(x)| \leq (2x-3) c_2 \frac{1}{\log x}.$$ The constants $c_1,c_2$ need not be equal, but $O$-notation simply says it is bounded by some constant. So we can just choose the largest constant of $c_1$ and $c_2$.