Find a bijective map $\Bbb R\to\Bbb R − \{0\}$ [duplicate]
Try this: $$f(x)=\begin{cases} x & x\notin \mathbb{N}\\ x+1 & x\in \mathbb{N}\end{cases}$$
Note: for this function, the domain is $\mathbb{R}$, and $\mathbb{N}=\{0,1,2,3,\ldots\}$. This function is the inverse of the one sought by OP.
This is simply a well known generalization of the method proposed by vadim123 which can be used to form a bijection between any two infinite sets where one set contains one more point than the other.
Let $X$ be one infinite set and $X_0 = X \backslash \{y_0\}$ the same set excluding a single point. Take any countable sequence $\{y_k\}$ of elements in $X_0$. Then we define a map
$$f : X \to X_0$$ which essentially pushes elements in $\{y_k\}$ "down the line" while inserting $x_0$ at the position occupied by $y_0$
$$f(x) = \begin{cases}y_0 & \text{if } x = x_0 \\ y_{n+1} & \text{if }x = y_n \\ x & \text{if } x \text{ is not in the sequence } \{y_k\}\end{cases}$$
Side note: Functions of this type are generally proposed as examples of non-continuous maps which which pull back open sets into non-open sets. Take $(0,1)$ into $(0,1]$.