Find the following maps: Find a bijective map $f :\mathbb{R} \to [0,1)$ and an injective map $f : \mathbb{R}\to \mathbb{R}\backslash \mathbb{Q}.$
I know some bijective maps from $\mathbb{R}\to (0,1)$, namely $f:(0,1)\to \mathbb{R}, f(x) = \dfrac{1-2x}{x(x-1)}$ and $f : \mathbb{R}\to (0,1), f(x) = \frac{1}2 + \frac{1}{\pi} \arctan(x).$ I also know a bijective map from $(0,1) $ to $(0,1],$ which is defined by $f(x) = x$ if $x\neq \frac{1}{2^n}$ for any $n$ and $f(x) = 2x$ otherwise (this function is injective and surjective). Also, a bijective map from $(0,1]$ to $[0,1)$ can simply map $x$ to $x$ if $x\in (0,1)$ and $1$ to $0.$ But composing three of these bijective maps to get the required bijection seems more complicated than it should be.
Also, as for an injective map from $\mathbb{R}$ to $\mathbb{R}\backslash \mathbb{Q},$ we can choose a bijective map from $\mathbb{R}$ to $(0,1)$, say $f(x) = \frac{1}2 + \frac{1}{\pi}\arctan(x)\,\forall x.$ Define $g: (0,1) \to \mathbb{R}\backslash \mathbb{Q}$ by $g(x) = x$ if $x\in\mathbb{R}\backslash \mathbb{Q}$ and $g(x) = \pi + x$ otherwise. Then $g\circ f$ gives the desired injective map.
Is there a shorter way to solve these problems?