$$f(x) = \begin{cases}x-1,&\text{ if }x\text{ is even}\\ x+3,&\text{ if }x\text{ is odd}\end{cases}$$
I know that I need $4$ cases in order to prove this function is one -to-one I have proven them all.
Two of the cases showed the function is one -to-one which are when $x,y$ are both even and $x,y$ are both odd. the two cases where the function fails to be one -to-one is when $x$ is even and $y$ is odd and when $x$ is odd and $y$ is even.
My question is if any of the cases failed is the function not one -to-one ?
Thank you in advance.