a) There is a net force on the dipole in the downwards direction. Imagine vectors representing the attraction and repulsion forces corresponding to each end of the dipole and add them. What you need to do is work out the vertical component of the force on each dipole and add them. Then you should get the right answer.
b) Here you have again failed to look at the components correctly. In a) you needed the component of the force in the vertical direction, now you need it in the horizontal direction (ie perpendicular to the axis of interest).
It is probably easiest here to think of torque as the distance from the axis (in this case the line perpendicular to the line joining the charges) multiplied by the component of the force perpendicular to the axis. This is equivalent to the definition you have given.
Really, the easiest way to think about torques is in terms of vector products, but if you haven't encountered them yet don't worry as the simplest mechanics/electromagnetism problems don't require them.