Continuous function from $(0,1)$ onto $[0,1]$
There isn't such a function. If $f$ is such a function, then $f$ is monotonic, and $f^{-1}$ too. But a monotonic function defined on an interval is continuous iff its range is an interval. So we have that $f$ is an homeomorphism from $(0,1)$ to $[0,1]$, which is impossible since one is compact and the other is non compact.
A slightly simpler solution, perhaps, for the first part would be as follows:
Consider the function from $\left[\frac14,\frac34\right]$ to $[0,1]$ defined by $x\mapsto 2\left(x-\frac14\right)$. This is certainly a continuous function, and it is certainly onto $[0,1]$.
Define now:
$$f(x)=\begin{cases}0 & x<\frac14\\ 2\left(x-\tfrac14\right) & x\in\left[\tfrac14,\tfrac34\right]\\ 1 & x>\frac34\end{cases}$$
Of course this is not an injective function, but it is continuous and onto, as required.
Your example for A is fine.
For B "for a continuous function on an interval, being one-to-one is equivalent to being increasing throughout or decreasing throughout" so that no such function exists.
(see (2.5)-(2.6) of this paper)