Welcome to PF;
Is the problem statement exactly as it was written down in front of you?
Guessing this is a 1D problem... so the equation for work comes out as:
##W = \int_{x_1}^{x_2}F(x)\;dx##
Since the force exists only at two points, that means that ##F(x)=a\big(\delta(x-x_1)+\delta(x-x_2)\big)## ... then the integration comes out to 2a or 0 - not sure about when the delta function is right on the limit of the interval. It would depend if that is ##x\in (x_1,x_2)## or ##x\in (x_1,x_2]## or ##x\in [x_1,x_2)## or ##x\in[x_1,x_2]##...
Maybe it means that ##F=ax## where a is a constant? Then the integration will work nicely.
Or maybe it is something else.