Suppose that a is a real root of the polynomial, then
a<sup>3</sup>+(3+i)a<sup>2</sup>-3a-(m+i)=0.
But Im(a<sup>3</sup>+(3+i)a<sup>2</sup>-3a-(m+i))=0 or a<sup>2</sup>-1=0. That means that a=±1.
Using those two possible roots, you find the values of m.