The "glider" you describe already exists and is used by oceanographers around the world to collect data in the oceans. It looks like a torpedo with little wings sticking out of its sides. It propels itself exactly as you describe: it releases a little air to become heavy and sinks- gliding forward as it does. When it reaches its assigned maximum depth, it adds buoyancy from a small air tank and begins to rise- gliding forward as it does. All the while it is measuring the salinity, acidity and temperature of the water, reading all this data to memory inside its onboard computer. When it reaches the surface, it streams this data via radio link to a satellite, and includes with it its GPS position. The radio link then programs the glider for another run in a new direction and sends it on its way.
A glider like this can autonomously profile the ocean for a month or two at a time before it runs out of air and battery power.