I suppose it is a hollow metallic sphere of radius R with a charge Q on it , uniformly spread around its surface.
W1 = work done = 0 when a +ve charge q is moved from a point A to another point B inside a +ve ly charged (with Q) metal sphere M.
W2 = work done ≠ 0 when q is taken from a point C to another point D outside the sphere M which is +vely charged with Q.
Inside a hollow metal sphere, the electric field is zero. The electric potential is constant though out the inside of the hollow sphere. Inside the hollow sphere, at a point A with the radius of r, the electric potential or electric field is contributed by the charge enclosed with in the radius r only. The charge which is outside the sphere of radius r, is equally distributed all around at a radius of R. So the repulsive force on q from one direction is cancelled by the repulsive force from the part of sphere in the opposite direction. Hence, the net electrical force or field is zero at any point inside the hollow sphere.
Since electric field is zero, force is zero. So work done is force times displacement is zero. OR, as the potential is same everywhere, the points all have same electric potential energy.
However, when a charge q is placed outside the (hollow or solid) sphere M, then the force of repulsion between Q and q are always in the same direction, away from M. So they add up. Thus the net electric force or field on q will be in the direction of line joining the centers of the two charges.
Then electric force on q = F = 1/(4πε) * Q q / d², where d = distance between the centers of the two charges.
The Electrical potential energy of the two charges when they are d1 and d2 distances away are : U1 = - 1/(4πε) * Q q / d1
and U2 = - 1/(4πε) * Q q / d2
Work done by this two charge system in moving the charge q from A (at distance d1) to B (at distance d2) is
W = U1 - U2 = - ΔU = 1/(4πε) * Q q [ 1/d2 - 1/d1 ]
Work done is negative, if the charge q moves under the influence of Q (of M). The work done is positive if an external force or agent moves the charge q.