Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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$?

share|cite|improve this question
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
up vote 4 down vote accepted

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.

share|cite|improve this answer
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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.