How to prove a piecewise function is 1-1

1.5k Views Asked by At

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

1

There are 1 best solutions below

0
On BEST ANSWER

Suppose $f(x)=f(y)$. First, $x$ and $y$ cannot have different parity (because you function maps odd values to even values and viceversa). For example, let's suppose that $x$ is odd and $y$ is even. Then, $$x+3=y-1$$ But this implies $y-x=4$, a contradiction since the lhs is odd and 4 is even. The other case ($x$ even, $y$ odd) is analogous. Therefore suppose $x,y$ have the same parity and $f(x)=f(y)$. If they are odd, then $x+3=y+3$ implies $x=y$. If they are even, same story. Therefore your function is 1-1.