Since the diameter must be within 0.001 mm, this means it can be greater than 5 by this amount or less than 5 by this amount. This is why we use an absolute value equation; absolute value describes distance.
Since it must be within 0.001 mm, this means the difference between our value, x, and 5 must equal 0.001; this is why x-5 goes in the absolute value bars and 0.001 goes across the equals sign.