You are right in saying that in your question, the gas is an non-ideal (real) gas. Basically, the reason why we use the ideal gas equation despite knowing that it is a real gas is simply because that the equation for real gases is too complicated and contain more variables which are hard to find given limited data.
The reason for this complicated formula is that several assumptions that we make for ideals gases don't hold for real gases. Recall that an ideal gas is considered to be a point mass - a particle so small that the volume of that particle is negligible. A real gas particle does have real volume. For an ideal gas, the collisions between gas particles was said to be "elastic" - no attractive or repulsive forces exist, and thus, no energy is exchanged during collisions. For a real gas, collisions are non-elastic. So, the ideal gas law must be corrected for this extra forces. There are several real gas laws, one is the van der Waals equation:
$$\left[P + a\left(\frac{n}{V}\right)^2\right](V-nb) = nRT$$
Notice how "corrections" are being made to the pressure term and the volume term. Since collisions of real gases are non-elastic, the term $a(n/V)^2$ is correcting for the interactions of these particles. Since real gas particles have real volume, the $nb$ term is correcting for the excluded volume. The values of $a$ and $b$ are constants, and must be determined experimentally for each gas.
As you can see from this equation that first the values of $a$ and $b$ must be known then you must solve this equation which can be complicated. Even then, when you do finally solve it, you will probably get a result which is similar to the result obtained if you used the ideal gas equation. This is why the ideal gas equation is continued to be used as in most cases it provides quite accurate results while bypassing complicated formulas.