The speed of sound is given by:
$$v = \sqrt{\gamma\frac{P}{\rho}} \tag{1} $$
where $P$ is the pressure and $\rho$ is the density of the gas. $\gamma$ is a constant called the adiabatic index. This equation was first devised by Newton and then modified by Laplace by introducing $\gamma$.
The equation should make intuitive sense. The density is a measure of how heavy the gas is, and heavy things oscillate slower. The pressure is a measure of how stiff the gas is, and stiff things oscillate faster.
Now let's consider the effect of temperature. When you're heating the gas you need to decide if you're going to keep the volume constant and let the pressure rise, or keep the pressure constant and let the volume rise, or something in between. Let's consider the possibilities.
Suppose we keep the volume constant, in which case the pressure will rise as we heat the gas. That means in equation (1) $P$ increases while $\rho$ stays constant, so the speed of the sound goes up. The speed of sound is increasing because we're effectively making the gas stiffer.
Now suppose we keep the pressure constant and let the gas expand as it's heated. That means in equation (1) $\rho$ decreases while $P$ stays constant and again the speed of sound increases. The speed of sound is increasing because we're making the gas lighter so it oscillates faster.
And if we take a middle course and let the pressure and the volume increase then $P$ increases and $\rho$ decreases and again the speed of sound goes up.
So whatever we do, increasing the temperature increases the speed of sound, but it does it in different ways depending on how we let the gas expand as it's heated.
Just as a footnote, an ideal gas obeys the equation of state:
$$ PV = nRT \tag{2} $$
where $n$ is the number of moles of the gas. The (molar) density $\rho$ is just the number of moles per unit volume, $\rho = n/V$, which means $n = \rho V$. If we substitute for $n$ in equation (2) we get:
$$ PV = \rho VRT $$
which rearranges to:
$$ \frac{P}{\rho} = RT $$
Substitute this into equation (1) and we get:
$$ v = \sqrt{\gamma RT} $$
so:
$$ v \propto \sqrt{T} $$
which is where we came in. However in this form the equation conceals what is really going on, hence your confusion.
Experimentally, the constant of proportionality for the above equation is approx. 20.
Yes, you're wrong.
Sound waves are small compressions (oscillations) of an elastic medium, travelling through that same elastic medium (as a wave). Air, liquids or solids are typical elastic media through which sound waves can travel.
Vacuum however contains no matter and cannot sustain sound waves at all.
Watch this video on a bell in a vacuum jar.
Best Answer
The speed of a sound wave (a longitudinal wave) in a gas can be shown, using Newton's second law, to be given by $$v=\sqrt{\frac{\gamma p}{\rho}}$$ in which $\gamma =\frac{\text {molar heat capacity at constant pressure}}{\text{molar heat capacity at constant volume}}$
$\gamma =1.4$ for diatomic molecules such as oxygen or nitrogen.
$p$ is the pressure and $\rho$ is the density.
At first sight you might say that the equation shows the speed of sound in (let's say) a diatomic gas to be inversely proportional to the square root of the density. This would be true if we had a cylinder full of nitrogen (relative molecular mass 28), and then replaced the nitrogen with oxygen (relative molecular mass 32) at the same pressure. The speed of sound in the cylinder would drop by a factor of $\sqrt \frac {28}{32}$.
But suppose that we didn't change the gas, but squashed it into a smaller volume by pushing in a piston very slowly so that the temperature change was negligible. It's easy to see that $$\frac{\text{new density}}{\text{old density}} =\frac{\text{old volume}}{\text{new volume}}$$ and from Boyle's law, that $$\frac{\text{new pressure}}{\text{old pressure}} =\frac{\text{old volume}}{\text{new volume}}$$ So the speed of sound would be unaffected by such a compression!
But we could increase the pressure without changing the density by increasing the temperature of the gas in the cylinder without changing its volume. We can then see from our equation that the speed of sound in the gas will increase. [This makes sense because molecules at a higher temperature have a greater random speed and will on average move faster between collisions, so passing on faster the superimposed velocities that represent the sound.]