2. The reference position is 0. You just need to find the smallest distance the particle ever is to 0. Basically, find the turning points (by setting the derivative to zero), and do make sure that the particle never actually reaches x=0, otherwise the smallest distance to 0 is, well, 0.
3. A general point on the line is given by (x,y) = (x, 7-x). You want to find the x value when the distance between (0,0) and this point is the smallest. Use the distance formula to find the squared distance (so as to not involve square roots). Minimising the squared distance is enough; you don't have to minimise the distance itself
4. Do the same thing; you want the distance between (x,-2x-5) and (3,7). Find the squared distance and minimise.
5a. For the vertical distance between two points, note that this means they have the same x value. Therefore, the distance between the two points is just the difference in the y values (you may need to be careful about the sign)