Fix for each $0\leq x<1$ some binary representation (for example, say that you use for each $x$ the representation not containing an infinite tail of ones).
Then $$ x=\sum_{j=1}^{\infty}2^{-j} [j\text{th digit in binary representation of }x\text{ is }1] $$ for any $0\leq x<1$, as follows pretty much directly from the definition of binary representations.
To extend this to all of $\mathbb{R}_{\geq}$ just extend the sum to $-\infty$.
To extend it to all of $\mathbb{R}$ just add the same representation with replacements $x\mapsto -x$ and $2^{-j}\mapsto -2^{-j}$