how to prove that this function is not injective I'm very new to proving that a function is injective, surjective, bijective, invertible etc.
So I'm supposed to prove that the function below is not injective.
$$f(x) = \frac{(-1)^x (2x-1) +1}{4}$$
Where $f:\Bbb N\to\Bbb Z$.
Well, I tried to consider: $$f(a) = f(b)$$
Which gives:
$$\frac{(-1)^a (2a-1) +1}{4} = \frac{(-1)^b (2b-1) +1}{4}$$
Then
$$(-1)^a (2a-1) = (-1)^b (2b-1)$$
And using log base $-1$:
$$a(2a-1) = b(2b-1)$$
Annnd finally:
$$2a^2 -a = 2b^2 -b$$
I know that if $a=0$ and $b=1/2$ they both get $0$ as the answer, but $b= 1/2$ isn't a natural number so I can't use that right?
So I guess I'm stuck here. Is there a way to break it down further to show that $a\neq b$?
 A: First of all, $\log_{-1}$ is not a well defined operation. Thus your solving starts to go wrong there. Instead, note that the $(-1)^x$ terms have no effect on the magnitude of the values, so we get
$$|2a-1|=|2b-1|$$
Now if the $a\neq b$, then it must be the case that $2a-1\neq2b-1$. By the above relation, we get that
$$2a-1=-(2b-1)$$
$$\Rightarrow a+b=1$$
From here, it seems that the injectivity of $f$ depends on the domain--specifically how $\mathbb N$ is defined. If in your class $0\in\mathbb N$, then we have the solution $a=1,b=0$. If $0\not\in\mathbb N$, as is more common, then this equation has no solution, and $f$ is injective.
Since your question seems to tell you that $f$ is not injective, we will assume the former.

Let $a=1,b=0$. Then $a\neq b$. Note:
$$f(a)=f(1)=\frac{(-1)^1 (2(1)-1) +1}{4}=0$$
$$f(b)=f(0)=\frac{(-1)^0 (2(0)-1) +1}{4}=0$$
A: $f(x)=f(y)$ iff $\frac{(-1)^x}{(-1)^y}=\frac{2y-1}{2x-1}\tag1$
since LHS can only be $-1$ or $1$, so must be $\frac{2y-1}{2x-1}$
if it is equal to $+1$ then $x=y$ and this is not useful, if it's $-1$ then $x-1=-y\tag2$
so take for example $x=5\rightarrow f(5)=-2$
$y=1-x=-4\rightarrow f(-4)=-2$
A: You can't use a logarithm with a negative base. The logarithm is only defined for positive base. The function $\log_{-1}x$ if it existed would return the value $y$ such that $(-1)^y = x$, but $(-1)^y$ is always $\pm 1$, so you can't in general expect for a solution.
Once you got to $(-1)^a (2a-1) = (-1)^b (2b-1)$ you can differentiate into cases. First if $a$ and $b$ are both even then you get $2a-1=2b-1$, hence $a=b$. The other two cases are $a$ and $b$ are both odd, and that one of them is even and the other is odd. Can you see how to finish the proof for these other two cases?
