note that g is the gravitational acceleration on test mass position, m due to Earth alone.
When test mass is on the right of the source mass say Earth, gravitational acceleration is
    

    1.
         g in the model or more generically  g is a
      vector quantity and the SI unit for g is N kg-1 (or m s-2).
      g is + when the test mass is on the left of the source mass Earth
      and g is - when the test mass is on the right of the source mass
      Earth M. in other words, the sign +/- depends on the direction
      (test mass left/right of Earth). Another way to visualize this
      look at the magenta color data line. 
      
      2.    The symbol chosen for the gravitational field
      strength is ‘g’. So far, in kinematics, we have been using g to
      represent the acceleration due to free-fall on the Earth’s surface
      which has the value 9.81 m s-2.
          
          But the generic gravitational field strength
      ‘g’ is not necessarily 9.81 N kg-1 (which is the value
      of g on Earth’s surface). Its magnitude varies with distance
      r  and mass M according to Eqn. 7.2.  

          
          To avoid misrepresentation, we will use the
      symbol, gE  to specifically represent the gravitational field
      strength at the Earth’s surface (ie gE = 9.81 N kg-1).
    
