A function $f(x)$ is $O(g(x))$ if and only if there exists a real number $M$ such that there exists $x_0$ such that for every $x>x_0$ the inequality $|f(x)|\le M|g(x)|$.
It turns out the following definition is equivalent to the one above: $f(x)=O(g(x))$ iff there exists a bounded function $h(x)$ such that $f(x)=h(x)g(x)$.
I guess it's not entirely true, because in the example below $f(x)=O(g(x))$, but you certainly can't express $f(x)$ as $h(x)g(x)$ for small $x$ with a bounded $h(x)$. So I believe there's one more requirements needed for equivalence - the function has to be bounded past some $x_0$.
If so, how can one prove these definitions equivalent?

You need to restrict your second definition to sufficiently large $x$: $f(x)=O(g(x))$ iff there is a bounded function $h$ and an $x_0$ such that for every $x>x_0$ we have $f(x)=h(x)g(x)$. Otherwise, if there is a small $x$ with $g(x)=0$, then $h(x)$ cannot exist at all, bounded or not.
Once that is done, however, proving the definitions equivalent is completely routine:
(1) implies (2): given $f$, $g$, $M$ and $x_0$, define $$ h(x) = \begin{cases} 0 & \text{if }x\le x_0 \\ 0 & \text{if }g(x)=0 \\ f(x)/g(x) & \text{otherwise} \end{cases} $$ Then by definition $h$ is bounded by $\pm M$, and $f=hg$ above $x_0$.
(2) implies (1): If you have a bound on $h$ you can use that bound as $M$.