My textbook says that critical temperature is the temperature above which a gas cannot be liquified no matter how much pressure we apply on it. But why? What is so special about this 'critical temperature'? I mean, if we apply a ridiculous amount of pressure, the gas molecules have to come closer to one another and they have to liquefy. What exactly happens to the gas molecules at critical temperature? Do they become immovable and have infinite inertia or what?
The critical point is a point of convergence of all state properties of the respective liquid and gas. It can be considered as the degeneration point, where there is no difference between gas and liquid and this distinguishing does not make sense any more.
It can be also said the supercritical fluid near the critical point is neither gas neither liquid. It is both at the same time. Farther from critical point, like for permanent gases, either gas-like either liquid-like properties are dominant, depending of the state.
By changing pressure of supercritical fluid, it gradually transforms between states, where it behaves more like gas or liquid, without evaporation or condensation. It is similar, as if you reach an elevated level via a big step (liquid/gas or evaporation/condensation) versus along a slope (supercritical fluid). For the latter, there is no upstairs (gas) nor downstairs(liquid), there is just the slope.
Imagine you figurally walk as the substance on the phase diagram ($T$ grows to the right, $p$ grows upwards) around the critical point. If you do it counter-clockwise, you will evaporate as many times as many rounds you do, without ever condensing. If you do so clockwise, you will condensate as many times as many rounds you do, without ever evaporating.
It really does liquefy. But it does not do so in exactly the same way as you see below the critical temperature and pressure.
As an example, suppose you heat steam to 400°C and then compress it, isothermally, to 5000 bars pressure*. When you are done, you find that the water has a density and viscosity more or less similar to ordinary liquid water; what was initially a gas now looks like a liquid.
What's different, however, is you see those physical properties evolve continuously, there is never a specific point where "gas" gives way to liquid droplets that are noticeably denser or more viscous than the gas. Instead the steam above the critical point becomes liquid-like in a smooth, gradual way during the compression process. You gradually contracted the gas until it became liquid-like instead of condensing it.
*These conditions are not sufficient to create ionic, superionic or macromolecular phases of water; we may continue to treat the water as a molecular substance.
One useful distinction between a liquid and a gas is that while they are in equilibrium with each other, so at the same temperature and pressure but not the same density, molecules of the liquid need to gain energy to leave the liquid phase and enter the gas phase. A surface, with surface energy, exists between the two phases, and allows them to segregate under gravity. The surface energy is due to the mutual attraction of molecules in the liquid being higher than that between those in the gas.
As the temperature is increased, the gas becomes denser, and so the inter-molecular forces within it increase, while the liquid is becoming less dense. At the critical temperature, the energy difference between molecules in the 'liquid' and 'gas' becomes zero. There is no longer any distinction between the two phases, and you have a single fluid.
My textbook says that critical temperature is the temperature above which a gas cannot be liquified no matter how much pressure we apply on it.
Below the critical temperature, you can compress a gas and a second phase (liquid) will gradually form. In places with gravity, the liquid will collect at the bottom of the container. As you decrease the volume, the volume of the liquid will increase and the volume of the gas will decrease, but the pressure will remain the same (at the vapor pressure of a given temperature). If you decrease the volume when the substance is supercritical, no second phase will form, but the particles will of course come closer to each other (just like when you compress a gas without liquifying it).
But why? What is so special about this 'critical temperature'?
In terms of the behavior of the particles, there is nothing special. They have a certain strength of intermolecular interaction when next to each other (like in a liquid), and no intermolecular interactions when further apart (like in an ideal gas). What is special is the behavior of the bulk phase, for example when being compressed.
I mean, if we apply a ridiculous amount of pressure, the gas molecules have to come closer to one another and they have to liquefy.
They don't have to liquify because we can define what we mean by liquid. They do have to come closer to each other on average. In a two phase system, that happens by gas turning into liquid. In a one phase system (gas or supercritical fluid) that happens by gas turning into liquid. In a liquid or solid, compression is hardly possible because of the strength of the repulsive intermolecular interactions at short distances.
What exactly happens to the gas molecules at critical temperature? Do they become immovable and have infinite inertia or what?
Nothing happens to them. They behave exactly as before. This is like at the melting point of water. The individual water molecules don't do anything differently. In bulk, however, you see a different set of properties.