I want to define a piecewise-defined bijection $f: \Bbb R \to (\Bbb R$ \ $ \{1\})$ but I'm stuck.
This means that I must define $f(x)$ by cases: $f(x) = g_1(x)$ if $x \in J_1$, $f(x) = g_2(x)$ if $x \in J_2$,... where $J_1,J_2,...$ are intervals.
I don't know if this one works:
$f(x) = \frac{1}{x}$ if $x \in (-\infty, 0) \cup (0,1) \cup (1, 2) \cup (2, \infty)$, $f(x)=0$ if $x=0$, $f(x)= 2$ if $x=1$.
Edit
$f(x) = \frac{1}{1-x}$ if $x \in (-\infty, 1) \cup (1,\infty), \ f(x)=0$ if $x=1$.