Plot[Piecewise[{{x, x <= 0}, {x*sin(1/x), x > 0}}], {x, -0.5, 0.5}]