On surjective functions

I'm having trouble with this question involving surjective functions.

If $h(x)=2x+1$ and $h$ maps from the integers to the integers, does there exist a function $g$ that maps from the integers to the integers so that $(g \circ h)(x)$ is onto?

If this is true, can someone provide an example of such a $g$?

-
What have you tried? –  Qiaochu Yuan Aug 2 '12 at 0:49
Nothing really. I'm kinda stuck on how to go. I'm assuming the answer is somewhat obvious. –  user979616 Aug 2 '12 at 0:52

For example, let $g(n)=\frac{n-1}{2}$ if $n$ is odd, and let $g(n)=n$ (or more spectacularly, $0$) if $n$ is even. If one wants a "formula," one can concoct one using trigonometric functions, but a definition by cases is clearer.

-
is that second case necessary? If h(x)=2x+1 then its inverse is (x-1)/2. If I apply both of these, i'll get back whatever x I put into h won't I? Also, note that the output of h(x) will always be an odd integer. –  user979616 Aug 2 '12 at 0:57
The value of $g$ at even integers doesn't matter, as the post may have indicated. But if we want $g$ to be defined at every integer, as the question asks, we do need to specify what $g$ does, for example, at $8$, or $-20$. –  André Nicolas Aug 2 '12 at 1:08
Maybe $g(n)=[(n-1)/2]$ (where $[x]$ is the integer part of $x$) gives a formula without trig functions and without (explicit) cases. –  Gerry Myerson Aug 2 '12 at 3:36