I am working on a problem involving asymptotic relations. Suppose $f$ and $g$ are two real functions with $g$ positively defined. Assume the usual asymptotic notations in number theory: we say $f(x)=O(g(x))$ if $|f(x)|\leq Cg(x)$ for some postive constant $C$, and $f(x)\asymp g(x)$ if $f(x)=O(g(x))$ and $g(x)=O(f(x))$. Does $$f(x)=g(x)\left(1+O\left(\frac{1}{x}\right)\right)$$ where $x>1$ imply $f(x)\asymp g(x)$?
The problem I am working on requires this implication. It is clear that $f(x)=O(g(x))$ (almost trivial, as $O(\cdot)$ provides an upper-bound). However, I cannot prove the other direction. Does this hold in general, or perhaps need other conditions?
Yes, this holds.
More precisely, read $f(x) = g(x)(1 + O(1/x))$ as $f(x) - g(x) = O(g(x)/x)$; in other words, there is some $C>0$ such that for all sufficiently large $x$, $|f(x) - g(x)| \le C g(x)/x$. Note that this implies that for all sufficiently large $x$, $g(x)>0$.
A consequence of this inequality is that $$ g(x) - f(x) \le C g(x)/x \iff g(x) \left(1 - \frac Cx\right) \le f(x). $$ If we choose $x$ to be both sufficiently large (for all the preceding inequalities) and also larger than $2C$, then $\frac{C}{x} < \frac{C}{2C}$, so $1 - \frac Cx > 1 - \frac {C}{2C}$, so $g(x)(1 - \frac Cx) > g(x)(1 - \frac C{2C})$, so $$ g(x) \left(1 - \frac C{2C}\right) \le g(x) \left(1 - \frac Cx\right) \le f(x). $$ Therefore $\frac12 g(x) \le f(x)$, or $g(x) \le 2 f(x)$, and we conclude that $g(x) = O(f(x))$.