It is stated in my textbook that temperature is the only factor that can change the equilibrium constant. According to the Ideal Gas Law, temperature is dependent on the pressure and volume. Thus, shouldn't pressure and volume change the equilibrium constant too?
Just like any sweeping statements made by the General Chemistry textbooks, this statement is also not completely true. When you work at pressure extremes, as in modern day chromatography, such as 1000 or higher bar, large molecules can change their shape, in that case, one can see a change in retention factors which sort of indicates a change in equilibrium constant with pressure under constant volume.
Just for fun, some solvents can become solids at high pressures-but this happens at another high-pressure level.
Coming back to routine reactions, pressure will not affect equilibrium constants because whenever you try to adjust the pressure in a gaseous reaction, the equilibrium concentrations will change in such a way that their ratio remains constant-hence the equilibrium constant does not change.
One way to think about it as that the equilibrium constant is a ratio of forward and backward rate constant. Changes in pressure or volume will not change the kinetic energy of the molecules but only temperature can change the kinetic energy and hence affect the rate constants.
According to the Ideal Gas Law, temperature is dependent on the pressure and volume.
Mathematically, this is incorrect. You would rather say that pressure and volume of a gas are functions of temperature i.e., the converse of what you wrote.