(i)
The domain of f(x) is all values of x, since 2-cos3x can never be zero because cos is between -1 and 1. The range has to include 1/3 when cos3x=-1, 1/2 when cos3x=0, 1 when cos3x=1, so 1/3<f(x)<1. f(x) is continuous.
(ii)
f(x) is two lines which are not continuous because each line consists of a series of points. The domain is all real x. The function is not continuous, but of course has a range of 0 and 1 but nothing in between.