There exist one-to-one functions from $(-\infty,0]$ onto $(0,\frac12)$. For a proof, consider first $f(x)=\frac1{2(1-x)}$. That maps $(-\infty,0)$ onto $(0,\frac12)$. We now need to change $f$ so $0$ can get mapped somewhere. The standard method is Hilbert's hotel: We let $g$ be function given by $g(x)=f(x)$ for $x\not\in\mathbb{Z}$, $g(0)=f(-1)$, $g(-1)=f(-2)$ and so on.
However, no continuous one-to-one function from $(-\infty,0]$ onto $(0,\frac12)$ exists. A continuous one-to-one function is either strictly monotone increasing or strictly monotone decreasing. It follows that $\lim_{x\to 0} f(x)$ must be $0$ or $\frac12$. As $f$ is continuous, $f(0)=0$ or $f(0)=\frac12$, so the function does not map into $(0,\frac12)$.