According to Newton's Law of Universal Gravitation, you simply need interacting masses in order to generate a gravitational force between them. Gases have mass and they therefore can contribute to gravity. So even if Jupiter is entirely gaseous, it is so incredibly massive besides (so much gas!), that it has a much stronger gravitational pull than Earth. The Sun is gaseous too, after all.
Be cautious, however, when someone compares gravitational forces so simply as "2.5 times". There is always a hidden assumption/reference in this because the force depends on more than just mass (e.g. distance). Earth's gravity is way stronger where I sit! In your teacher's case, it is probably meant that the gravitational force felt at the surface of Jupiter is 2.5 times what you would feel on the surface of Earth. To choose a "surface" for a gaseous planet, you need to make more assumptions.
Anyhow, for the titled question, it is highly likely that Jupiter is not entirely gaseous. With all of that matter (not just hydrogen and helium, but everything else everything in our solar system is made of) and all of that gravitational pull, you are bound to have precipitated solids that condense into a solid planetary core.