This can be transformed into a standard problem in linear finite differences. First we multiply both sides by $f(x)$ and divide by $q$ to arrive at
$$ f(x+1) = \frac{1}{q} \frac{h(x+1)}{h(x)} f(x) $$
Then subtract $f(x)$ to yield
$$ f(x+1) - f(x) = \left( \frac{h(x+1) - qh(x)}{qh(x)} \right)f(x) $$
Which can be written as
$$ D_{1,x} f+ \left( \frac{qh(x) - h(x+1)}{qh(x)} \right)f(x) = 0 $$
Whereas $$D_{h,x}f = \frac{f(x+h) - f(x)}{h}$$ the use of $h=1$ above naturally gives us $f(x+1) - f(x)$ as desired.
So given any $h(x)$, I mean any! we can find a find an f that satisfies above. The full proof requires the use of the theory of finite differences. First observe
$$ D_{1,x}[2^x] = 2^{x+1} - 2^x = 2^x$$
Furthermore we can generalize that result to,
$$ D_{1,x}[2^{g(x)}] = 2^{g(x+1)} - 2^{g(x)} = 2^{g(x)}(2^{g(x+1)-g(x)} - 1) = 2^{g(x)} (2^{D_{1,x}[g(x)]} - 1) $$
Furthermore, we create a product rule of sorts,
$$ D_{1,x}[f(x)g(x)] = D_{1,x}[f(x)] g(x) + f(x)D_{1,x}[g(x)] + D_{1,x}[f(x)]D_{1,x}[g(x)] $$
To verify that last product rule, just expand each $$D_{1,x}$$ term into the defintion from above, and just algebraically simplify. One final tool to remark on is the idea of
$$D_{h,x}^{-1}[f] $$
Which is simply the function $g(x)$ such that $D_{h,x}[g] = f$$ If you want a more rigorous treatment of how to define it, please mention in comments, I can give more intuition into it. For the remainder of this we will assume that it is a well defined operator, that can be taken of its argument.
From here we wish to solve for $f(x)$
$$ D_{1,x}[f(x)]+ \left( \frac{qh(x) - h(x+1)}{qh(x)} \right)f(x) = 0 $$
We will utilize a pair of integration factors. Let us attempt to find two functions $u_1(x), u_2(x)$ such that
$$ D_{1,x}[u_1(x)f(x)] = u_2(x) \left( D_{1,x}[f(x)]+ \left( \frac{qh(x) - h(x+1)}{qh(x)} \right)f(x) \right) $$
After distributing we arrive at
$$ D_{1,x}[u_1(x)f(x)] = D_{1,x}[u_1(x)]f(x) + u_1(x)D_{1,x}[f(x)] + D_{1,x}[u_1(x)]D_{1,x}[f(x)] $$
$$ u_2(x) \left( D_{1,x}[f(x)]+ \left( \frac{qh(x) - h(x+1)}{qh(x)} \right)f(x) \right) = $$
$$ u_2(x) D_{1,x}[f(x)] + u_2(x) \left( \frac{qh(x) - h(x+1)}{qh(x)} \right)f(x) $$
So we can equate terms
$$ u_1(x)D_{1,x}[f(x)] + D_{1,x}[u_1(x)]D_{1,x}[f(x)] = u_2(x) D_{1,x}[f(x)] $$
$$ D_{1,x}[u_1(x)]f(x) = u_2(x) \left( \frac{qh(x) - h(x+1)}{qh(x)} \right)f(x)$$
Then divide through by common terms to find:
$$ u_1(x) + D_{1,x}[u_1(x)] = u_2(x) $$
$$ D_{1,x}[u_1(x)] = u_2(x) \left( \frac{qh(x) - h(x+1)}{qh(x)} \right)$$
Subtract the second equation from the first to find
$$ u_1(x) = \left(1 - \frac{qh(x) - h(x+1)}{qh(x)} \right) u_2(x) $$
Now look at the second equation in the system of 2. We assume that $u_2(x) = 2^{E(x)} $ then it follows that
$$ D_{1,x}[u_1(x)] = D_{1,x}\left[1 - \frac{qh(x) - h(x+1)}{qh(x)} \right]u_2(x) + \left(1 - \frac{qh(x) - h(x+1)}{qh(x)} \right)D_{1,x}[u_2(x)] = u_2(x) \left( \frac{qh(x) - h(x+1)}{qh(x)} \right) $$
Which means
$$ D_{1,x}\left[1 - \frac{qh(x) - h(x+1)}{qh(x)} \right] + \left(1 - \frac{qh(x) - h(x+1)}{qh(x)} \right)2^{D_{1,x}[E(x)]} = \left( \frac{qh(x) - h(x+1)}{qh(x)} \right) $$
Thus it follows,
$$ 2^{D_{1,x}[E(x)]} = \frac{\left( \frac{qh(x) - h(x+1)}{qh(x)} \right) - D_{1,x}\left[1 - \frac{qh(x) - h(x+1)}{qh(x)} \right]}{\left(1 - \frac{qh(x) - h(x+1)}{qh(x)} \right)} $$
Giving us
$$ E(x) = D_{1,x}^{-1} \left[ \log_2 \left(\frac{\left( \frac{qh(x) - h(x+1)}{qh(x)} \right) - D_{1,x}\left[1 - \frac{qh(x) - h(x+1)}{qh(x)} \right]}{\left(1 - \frac{qh(x) - h(x+1)}{qh(x)} \right)} \right) \right] $$
Meaning
$$ u_2(x) = 2^{D_{1,x}^{-1} \left[ \log_2 \left(\frac{\left( \frac{qh(x) - h(x+1)}{qh(x)} \right) - D_{1,x}\left[1 - \frac{qh(x) - h(x+1)}{qh(x)} \right]}{\left(1 - \frac{qh(x) - h(x+1)}{qh(x)} \right)} \right) \right]}$$
$$ u_1(x) = \left(1 - \frac{qh(x) - h(x+1)}{qh(x)} \right)2^{D_{1,x}^{-1} \left[ \log_2 \left(\frac{\left( \frac{qh(x) - h(x+1)}{qh(x)} \right) - D_{1,x}\left[1 - \frac{qh(x) - h(x+1)}{qh(x)} \right]}{\left(1 - \frac{qh(x) - h(x+1)}{qh(x)} \right)} \right) \right]} $$
And since
$$ D_{1,x}[u_1(x)f(x)] = u_2(x) \left( D_{1,x}[f(x)]+ \left( \frac{qh(x) - h(x+1)}{qh(x)} \right)f(x) \right) = 0$$
It follows that
$$ u_1(x)f(x) = C$$
(C is the finite difference integration constant) and from here
$$ f(x) = \frac{C}{u_1(x)} $$
Giving us
$$ f(x) = \frac{C}{1 - \frac{qh(x) - h(x+1)}{qh(x)})}2^{-D_{1,x}^{-1} \left[ \log_2 \left(\frac{\left( \frac{qh(x) - h(x+1)}{qh(x)} \right) - D_{1,x}\left[1 - \frac{qh(x) - h(x+1)}{qh(x)} \right]}{\left(1 - \frac{qh(x) - h(x+1)}{qh(x)} \right)} \right) \right]} $$
So in short, name your h(x), ANY h(x), and that freakish clusterf--- of an expression will give you the f(x) that satisfies your problem.