Plato has covered all three possible cases to show when f(a) = f(b) then a = b. The first two examples show that f(a) = f(b) then a = b. So far so good. The third is where things get dicey, but note that if and b < 0 then there is a contradiction...f(a) is even whereas f(b) is odd. This obviously cannot happen as an even number can never be equal to an odd number. This means that there is no "overlap" of the two pieces. My (first) question to you is "Why is the third case necessary?"
My second question is why aren't you seeing this? It sounds very much like you are either looking for a full solution (which we generally do not give) or you aren't putting effort into this. Spend some time with the above quotes and see if things make more sense. You are posting in the Discrete Math forum! Heck, I haven't taken Discrete and I'm following his reasoning so you should be well beyond many of the difficulties I'm seeing you have here. Plato has been very patient about all this. Play him back by working some more at it.