Indeed you can use Avogadro's law here, but I guess it is useful to give a little bit more insight in Avogadro's Law. What you can do is apply the ideal gas law:
$$p V = n R T $$
Here $n$ is the amount of substance of gas, which you can also write as:
$$ n=\frac{m}{M},$$
where $m$ is the total mass of the gas and $M$ is the molecular mass.
You can rewrite the ideal gas law now to:
$$p M = \frac{m}{V} R T,$$
where you should recognize that $\frac{m}{V}=\rho$.
The gas constant $R$ is (as the name shows) a constant so you can write
\begin{align}
R &=\frac{p M}{\rho T} &
\rightarrow &&
\frac{p_1 M_1}{\rho_1 T_1}&=\frac{p_2 M_2}{\rho_2 T_2}
\end{align}
And therefore, for equal pressure and temperature you will find that
$$\frac{M_1}{\rho_1}=\frac{M_2}{\rho_2},$$
which means that if the density of gas 2 (the unknown gas $\ce{X}$) is $10$ times as high, the molecular mass should be as well.
What is interesting to add is that this assumes the ideal gas law to be applicable. If, for example, your gases would be at high pressure (e.g. $\pu{200 bar}$) this is typically not a good assumption so the molecular mass that you would find for a $10$ times as dense gas will not be equal to $10$ times the molecular mass of hydrogen.