If g is a real-analytic function defined near x0 with g(x0) = x0 and 0 < λ ≠ 1 where λ := g'(x0), then Koenigs proved that there exists a real-analytic homeomorphism h defined near x0 such that hgh-1(x) = L(x) where
L(x) := x0 + λ(x-x0)
and h is unique up to a constant factor*.
This allows g to be embedded in a local flow: Φ(x,t) := h-1 Lt h(x), where
Lt(x) := x0 + λt (x-x0),
such that Φ(x,1) = g(x) where defined.
Then Φ satisfies the differential equation dx(t)/dt = V(x(t)) where the velocity V (denoted by f in the Question) is given by
V(x) := ∂Φ(x,0)/∂t.Φ(x,t)/∂t |t=0.
Note, however, that the flow Φ(x,t) into which the original function g embeds as the time-1 map need not be unique when there exist more than one fixed point of g. As an example, for x > 0 consider the function
gc(x) := cx.
Then for 1 < c < e1/e the function gc has two distinct fixed points each satisfying the hypotheses of the Koenigs theorem, and these give two distinct flows into which gc embeds as the time-1 map.
Concretely, set c = √2, so that gc(x) = x for both x = 2 and x = 4, with derivatives
gc'(2) = ln(2) and
gc'(4) = ln(4).
Calculating the respective real-analytic flows Φ2(x,t) and Φ4(x,t), both are defined for (x,t) = (3, 1/2).
But Φ2(3, 1/2) and Φ4(3, 1/2) first differ in the 25th decimal place. Hence they are solutions of distinct differential equations. I.e., they have different velocity functions.
* This is actually true in greater generality; see J. Milnor's book Dynamics in One Complex Variable, 3rd ed., Princeton University Press, 2006.