SPOILER
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
The function is g(n) = 1 - n
It satisfy all three requirements by inspection.
Proof of uniqueness by induction:
Since g(0) = 1, g(g(0)) = g(1) = 0 (from a and c).
Assuming that g(n) = 1 - n for n = 1, 0, ..., m where m is a negative integer:
g(g(m + 1) + 2) = m - 1 (from b)
Since g(m + 1) = 1 - ( m + 1 ) = -m, g(2 - m) = m - 1
g(m - 1) = g(g(2 - m)) = 2 - m = 1 - (m - 1) (from a)
This proves that g(n) = 1 - n for any negative n.
For positive n >= 2 g(1 - n) = 1 - ( 1 - n ) = n since 1 - n is negative.
Now g(n) = g(g(1 - n) = 1 - n (from a).
Please reply to ilan dot mayer at hotmail dot com
__/\__
\ /
__/\\ //\__ Ilan Mayer
\ /
/__ __\ Toronto, Canada
/__ __\
||