there are two cases when the magnification (in magnitude) can be same . One is when it is between f and c and other is when object is between pole and f.
1/v + 1/(-x1) = 1/(-f) .. (1)
=> 1/v = (f - x1)/(x1.f)
=> v = (x1.f)/(f - x1)
|m| = |v/u| = |f|/|f - x1| = |f|/|f - x2|
=> |f - x1| = |f - x2|
now we know that one of x1,x2 is less than f and other is greater than f
=> f - x1 = -(f - x2)
=> x1 + x2 = 2f
=> f = |(x1 + x2)/2|