One way is to parametrise the path r(t) corresponding to the graph of tan(x). Then find r'(t). Another way is to note that dy/dx gives you the relationship between the y and x components of the unit vector. Draw out the dy/dx triangle to see why. Now you should be able to find it.
B)Now you've got the vector you should be able to find the unit vector perpendicular to it.
