Can water pressure ever become high enough to trap gas bubbles and/or keep them from surfacing?
The highest pressure in the ocean is at the bottom of the Mariana trench, where the pressure is 1 086 atmospheres. Using the online calculator for the properties on nitrogen at 4 °C and 1 000 atmospheres the density comes out as 602 kg/m³, which is still less than water. So a bubble of nitrogen would rise even at the deepest point in the ocean.
Response to comment:
In principle we can continue increasing the pressure and the nitrogen should get denser. However at temperatures above 0 °C and the sorts of pressures we are talking about, nitrogen is a supercritical fluid so it does not obey anything like an ideal gas law. Calculating at what point the density would exceed the density of water is far from easy.
The effect of pressure on water is straightforward. At sea bottom temperatures (about 4 °C) the density of water increases only slowly with pressure to about 1 050 kg/m$^3$ at 6 000 atmospheres, at which point the water freezes to form ice V. So the question is whether the density of nitrogen exceeds 1 050 kg/m³ below a pressure of 6 000 bar.
I can’t find any figures for the density of nitrogen at these sorts of pressures and temperatures, though I did find this paper that gives a Mie-Grüneisen type equation relating the density, pressure and temperature. Unfortunately the preview only shows two pages and the rest of it is behind a paywall. However using the figures they give and waving my arms around a bit I find the density of nitrogen rises to 1 050 kg/m³ at around 4 000 atmospheres.
So, it might just be possible to get a nitrogen bubble that is denser than water and will sink instead of floating. But I don’t know whether the equation from the paper I cited is accurate at these sorts of pressures and temperatures, and it’s possible the nitrogen will solidify before the water does (though I’d guess not).
In case your question stemmed from seeing a similar phenomenon yourself, what you saw might have been an antibubble. An antibubble is a droplet of water, encased in a thin shell of air, suspended in water. These are pretty unstable in nature, so they're rarely observed unless artificially induced.
An antibubble will have roughly neutral buoyancy, being composed almost entirely of the medium it is suspended in, and will therefore accelerate neither upwards nor downwards (unless disturbed). This means it can easily be mistaken for an anomalous gas bubble that is "trapped" in place.
If you fill a glass tube with water, and then pull a vacuum on it, at some point bubbles will start to form. Increase the vacuum, and the bubbles will rise. Reduce the vacuum and the bubbles will disappear.
What's going on there is that the water is evaporating to form the bubbles. There is a continual motion of water molecules across the bubble interface, moving from vapor to liquid. The process is highly dependent on pressure. If more molecules are becoming vapor than are becoming liquid, then the bubbles grow until equilibrium is reached.
Something similar can happen with dissolved CO2 or dissolved nitrogen in water, which explains why soda in a closed bottle does not keep making bubbles, and why divers need to ascend slowly from great depths to avoid "the bends": formation of nitrogen bubbles in their blood and tissues. Solubility of CO2, nitrogen, and other gasses is highly pressure-dependent.
See for example this link.
The above answers don't answer the initial question, but rather other one's not asked. The soda "answer" is an example of a closed container with equal preasure at all points, and thus no buoyancy effect present. The Marianas Trench "answer" again changes the question by delving into the q of at what pressures can you force a gas to be higher density than water, but in the 'answer' example the same buoyancy pressures (more pressure lower than higher on the air bubble pushing more below than above) are discussed as in any country club pool, just higher psi involved.
The question is skirted and changed in the above "answers". So if this isn't done, if a very strict scenario is in place forcing an answer to the question asked and not another one, then how would you answer?
Scenerio - a 20 foot deep pool filled with water with a walled cylinder dropped in virtically and the bottom of the cylinder sealed to the floor of the pool, with the cylinder walls 10 feet high. Within the cylinder on the floor all across it's circumference is a one foot high container of air that has a lower psi than the water above it but the air is, for now, trapped by a top that can be swiftly slid off. So, in this hypo there is no surrounding higher psi water below or around the air to cause uoward buoyancy effects, it (the higher psi water) is all higher to start than the lower psi air.
I believe this is the initial question asked (put more rigidly to stop the above recited answering a different q issue) - what if all of a sudden the air container top is extremely swiftly slid off through a slot in the cylinder wall. Will the lower psi air be trapped by the higher psi water above it?
And the answer is....... No, the air will not be trapped, but will rise. But more correctly, actually the pressure above will compress the lower air very quickly until the air reaches the same psi as the water, and gravity will 'force' the water downward seeping between the air molecules and a process will begin wherein the water will displace the air and at some point (very, very quickly) there will be present a two-phase mixture wherein the pressure of the water will be greater upon the separated (now) air bubbles bottoms than tops, and the normal buoyancy effects come into play, causing the air to rise to the top. And walla, all is right with the world; and it is once again safe for democracy.