Edit: The JPL Mars Helicopter Scout will use inertial navigation:
The inconsistent Mars magnetic field precludes the use of a compass for navigation, so it will use a solar tracker camera integrated to JPL's visual inertial navigation system. Some additional inputs might include gyros, visual odometry, tilt sensors, altimeter, and hazard detectors.[15]
There are other ways to navigate than GPS.
- Inertial navigation uses accelerometers to detect in which direction you're moving, and speed or distance sensors to detect how far you've gone. Used e.g. by submarines to navigate when they're underwater and out of GPS reach. Also used by current Mars rovers.
- You can use radio direction finding. With 2 transmitters in known locations, you can triangulate your position. With 1 transmitter navigation is more limited but you can still get back to the transmitter location. Used in WW2 by aircraft.
In addition to knowing your position, you need to know something about the terrain around you. You need to know which spots can be traversed, and which are too steep/rocky/soft for the vehicle to traverse. For an aircraft, you need to know where the mountains are and where it's safe to land.
You can use a map built by someone else as your reference (this is what satnav in your car does), or you can build your own map as you go along.
The current Mars rovers have demonstrated autonomy: they take pictures of the terrain ahead, and they can choose a safe path. GPS is not necessary for this.