Use definition of the analytic function and check if f(z)=[sin(PI/z)]/(z+2)
meets the requirement given in definition. You should be aware that there are several ways to define the function to be analytic, such as expanding by power series, Cauchy-Riemann condition, etc. (in principle all equivalent). You can use that you learned best.
I guess by z you mean complex variable. But we can verify analyticityof real functions as well.