When considering buoyancy in a gaseous medium, if the gas has the same density everywhere, is it possible for buoyancy to exist? Or the gas need to be more dense in the lower layers for the buoyancy to exist? In liquid, there is no density difference, but there is pressure difference. So in a gas, there must be also pressure difference for the buoyancy to exist, so does that mean that there must be a density difference due to gravity?
To answer your question you need to consider how the buoyancy effect arises.
It is much easier to consider a particular case rather than a general one.
The left hand diagram shows a cylinder of fluid (red) in equilibrium with the rest of the same fluid (blue).
You can now consider the red cylinder of fluid as a system.
That red fluid has two sets of forces acting on it.
The attractive force due to the gravitational attraction of the Earth $W$ downwards and the forces due to the blue fluid.
If the cylinder is vertical then the net horizontal force on the red fluid due to the blue fluid is zero.
The net force up due to the blue fluid is $F_B-F_T$ and if the area of the ends of the cylinder is $A$ then this force is $(P_B -P_T)A$
Since the red fluid is in equilibrium $W= (P_B -P_T)A$
This tells you that the buoyancy effect (weight of fluid displaced) is due to the difference in pressure between the bottom and top of the cylinder.
That pressure difference will depend on the distance between the top and bottom of the cylinder, the density of the blue fluid and gravitational field strength.
A change in density of the blue fluid with height will obviously affect the pressure difference but if that change in density is relatively small which is often the case, it is the vertical height which is the more important factor.