The first part of your piecewise function has positive slope, and so will pick up all the negative numbers, and some positive reals, for suitable choice of $m$. Your second part needs to pick up the rest, which includes "most" of the positive reals. In particular, you need $m > 0$, or else this won't happen. This was all just to understand what was going on in the problem.
The easiest way to actually find some $m$ which does what you want is to set the two equations equal to each other, plug in $x=3$ and solve: \begin{align*} &\quad x+m = mx+2 \\ \Rightarrow &\quad 3+m = 3m +2 \\ \Rightarrow &\quad 1=2m \\ \Rightarrow &\quad m=\frac{1}{2}. \end{align*} Now, does this work/make sense? Well, when you plug it back into your function, the first part is $x+\frac{1}{2}$ for $x\in (-\infty,3]$ and the second part is $\frac{1}{2}x + 2$ for $x\in (3,\infty)$. Then by observation it's clear that $f$ is surjective.
EDIT: As pointed out in the comments, this isn't the only solution. In particular, see the answer below by Siminore, as well as the comments to this answer.