In classical mathematics, following two statements are equivalent:
If $f(x) = f(y)$ then $x = y$ for each $x$ and $y$.
If $x\neq y$ then $f(x)\neq f(y)$ for each $x$ and $y$.
However, in a constructive sense, they could not be equivalent. Clearly, 1 implies 2, but the other direction is not trivial.
My question is:
a) Is there a counterexample $f$ (in constructive sense) satisfying 2. but not 1.? I think some function over reals (I even don't know about real numbers in the constructive sense!) might be a counterexample, but I can't find it.
b) Consider the function $f:\Bbb{N}\to\Bbb{N}$. If $f$ satisfies 2 then it should satisfy 1? For computable $f$ it seems trivial but I don't certain in case of more complex $f$.
Thanks for any help!