Aded in edit: as pointed out by Christian Remling, my answer assumes implicitly that $f'$ never vanish.
The question is basically whether diffeomorphisms of the line isotopic to identity embed in flows; this is know to be very false in compact manifolds (see the work of Palis and this MO questionthis MO question), but I do not know the answer for the line. Here is a reduction of the problem.
Assume $g$ exists as wanted, let $y$ be a point not fixed by $f$ (if $y$ is fixed then we set $g(y)=0$), and let $x$ be the solution of $x'=g(x)$ such that $x(0)=y$. Then by separating variables, we get $$ \int_0^1 \frac{x'(t)}{g(x(t))} dt = 1$$ then by using the variable $u=x(t)$, we get $$ \int_y^{f(y)} \frac{du}{g(u)} =1$$ Denoting by $G$ an antiderivative of $1/g$ (which must be well defined away from the fixed points of $f$), we are reduced to solve the functional equation $$ G\circ f - G =1.$$ Now, given the structure of the line, it is not difficult to construct solutions of this equation by chosing them almost arbitrarily on a fundamental domain and then extend by the functional equation... but this works only on each interval between two fixed points of $f$. The issue of gluing these solutions at fixed points to get a decent $g$ seems not so easy to me (note that $G$ diverges at fixed points, which is pretty unsurprising given that $g$ should vanish there). However, in some cases (e.g. $f$ has no fixed point), it can certainly be done.