I am trying to find the inverse of the following function $f:\mathbb{Z}^+\rightarrow \mathbb{Z}$ given by $f(a)=\frac{(-1)^a(2a-1)+1}{4}$.
I switched $x$ and $y$ and then tried solving for $y$. This is the technique that everyone learned back in middle school/high school. However, since the inverse relation isn't a function, it is not possible. How do I find the inverse using a different method?
Here, the inverse function exists :
$$g(x)=2n$$ for $n>0$ and $$g(x)=-2n+1$$ for $n\le 0$
$f$ is actually a function from $\mathbb Z^+$ to $\mathbb Z$