First of all, we should note that $\sin(1/x)$, as it stands _is_ continuous wherever it is defined. By that, I mean that $\sin(1/x)$ is not defined for $x=0$, so we have to assume that $x\
eq 0$ when evaluating $\sin(1/x)$. Frequently, we avoid this problem by writing $$g(x)=\begin{cases} \sin(1/x) & x\
eq 0\\\ 0 & x=0.\end{cases}$$ This is probably the function you mean to use, or at least something like that. As you note, $g(x)$ is discontinuous at $0$. Suppose that $g(x)+x=f(x)$ was continuous. Then $g(x)=f(x)-x$. Since the difference of continuous functions is continuous, $g(x)$ is continuous. But this is a contradiction. Therefore, $g(x)+x$ cannot be continuous.