Find a left-inverse for the function $f:\Bbb Z \to \Bbb Z$ given by $f(n)=2n+1$.
Verify that your answer is correct. Does f have a right-inverse? Explain.
Hi all, I need to asses whether this function is left and/or right invertible, and then prove it using proper proof language. I'm trying to follow the way my professor taught me, but I'm not really sure I understand what I'm doing.
This is what I have:
Theorem. $f$ is left-invertible.
Proof.
$f$ is left-invertible if there is some function $g:\Bbb Z \to \Bbb Z$ such that $g \circ f = id_{\Bbb Z}$. Consider $g(n)=\frac{n-1}{2}$. Then, $g \circ f(n) =\frac{2n+1-1}{2}=n=id_{\Bbb Z}$. Therefore, $f$ is left-invertible.
Does that make any sense so far? Honestly, it doesn't make any sense to me. The other problem is that using a similar strategy, I find that $f$ is also right-invertible. However, I know that not to be true, because $f(1)=3$ and $f(2)=5$, and thus there is no $n\in\Bbb Z$ such that $f(n)=4$ (aka, the function only spits out odd numbers if we restrict the domain to integer inputs). Therefore, it is not survective. If anyone can help me understand, perhaps from the beginning, how to properly do this problem and write it out, that would be amazing.
Cheers
Your formula for $g(n)$ doesn't ensure $g(n)\in\mathbf Z$. To make it work, you should take $$g(n)=\biggl\lfloor\frac{n-1}2\biggr\rfloor.$$
If $f$ had a right inverse, it would be surjective, which isn't the case.
Note that a function with a left inverse is injective, which is indeed the case.