Consider I have a simple formula for the work along some path (in 1 dimension):
$$W~=~\int_{x_0}^{x_1}\vec{F}\cdot d\vec{x}.$$
If I now move from left to right ($x_1 > x_0$) along the axis (assuming the X-axis points right) it is obvious that (using unit vectors along the axis):
$\vec{F}=F\vec{i}$
$\vec{x}=x\vec{i} \ \ => \ \ d\vec{x}=dx\vec{i}$
$\vec{F}d\vec{x} = (F\vec{i})(dx\vec{i})=Fdx$
Integration gives (assuming constant force along path for simplicity):
$\int_{x_0}^{x_1}\vec{F}d\vec{x} = \int_{x_0}^{x_1}Fdx = F \int_{x_0}^{x_1}dx = F(x_1-x_0) > 0$
Consider now I move from right to left ($x_1 < x_0$) but the force is also reversed, then:
$\vec{F}=-F\vec{i}$
$\vec{x}=-x\vec{i} \ \ => \ \ d\vec{x}=-dx\vec{i}$
$\vec{F}d\vec{x} = (-F\vec{i})(-dx\vec{i})=Fdx$
$\int_{x_0}^{x_1}\vec{F}d\vec{x} = \int_{x_0}^{x_1}Fdx = F \int_{x_0}^{x_1}dx = F(x_1-x_0) < 0$
Obviously, there is some terrible mistake here in my reasoning... If we move from one point to another along the force direction the work must be positive.