the population inversion is achieved by the pumping of the laser active medium, not by the cavity. you may want to check the literature on modeless dye lasers, in which there is no cavity
As in the answer by Johannes, the inversion is achieved by pumping and depleted by lasing. This is no different for random lasers. If you pump hard enough you will achieve inversion and if you have enough inversion (gain) to exceed the threshold you will see lasing. It depends on the cavity dynamics whether you will end up with relaxation oscillations and multimode lasing (likely for a random scatterer) or CW lasing (only for very controlled situations)
In a random laser the scattering serves as the mirrors in the cavity. Therefor lasing is achieved if there is some scattering pathway loop that experiences a net gain (where the gain exceeds the loss). Lasing wil happen (and compete) on multiple pathways if they all exceed the threshold. A special case is reserved for scattering that is so strong that the light is effectively confined (Anderson localisation) but this is not a requirement for lasing.
So basically you just have to pump hard enough. It is eaasier if the scattering of your pump light is less then the scattering at the lasing wavelength so that the pump can penetrate inside the scattering material but that depends on the (wavelength dependence of the ) scattering properties.
It is quite an easy question. Certainly, there is no need in cavity (or a resonator, that means the same) for obtaining population inversion. The latter is obtained by pumping an active medium (or gain medium) by different ways. However this medium can be used as an power amplifier for the laser radiation. Altogether, I would strongly recommend you to read the excellent book “Lasers” by Anthony Siegman.
Basically pumping process may create lasing with a cavity. But, almost all commonly used lasers definitely have cavities, except in case of fiber lasers where a traditional cavity is not used.
Lasers without mirrors have been known for some time and are know as superradient lasers and are associated with high gain. UV nitrogen, some dyes, and some far infrared gases such as methyl fluoride. In addition, a number of astronomical masers have been detected and one can hardle expect a cavity to be present for these.
Population inversion is state or a condition in which the atoms or molecules population in higher energy state or level more than in lower energy level. This can be achieved by pumping these entities by many methods. This is possible only in the quantum material systems in which metastable energy levels are existing because the life time of atoms or molecules is more in metastsble energy levels than in any higher excited energy level. Hence there is no relationship between cavity and population inversion but a resonance cavity is a device which part of laser contains a tubical structure enclosed two mirrors separated by a active or quantum material system within which between two energy levels population i inversion created for lasing action and distance between two mirrors adjusted to achieve constructive interference between emmitted laser light waves which is help of cavity. This case only in case many lasers but in case semiconductor laser no cavity is present. Cavity depends on the type of the laser.
You can have population inversion without a cavity, if you pump enough.
However, this is not enough for having lasing emission. For lasing you must have a feedback, and this is the role of the cavity. With no cavity, you will only have Amplified Spontaneous Emission (ASE): spontaneously emitted photons multiplied by stimulated emission as they hit an excited molecule of the active material . In this case you have an amplification chain with no feedback. It is like an electronic amplifier fed with noise.
Feedback given by cavity makes the stimulated emission process dominant with respect to ASE. Above lasing threshold, photons that satisfy the round trip condition (see "Lasers" by Siegman) are amplified at each round trip. One can sees the cavity as the frequency filter in feedback path of electronic oscillators.
The main point here is not to confuse population inversion with lasing threshold.
Concerning random lasers, the definition of a cavity is not straight forward as the feedback in RLs is spatially distributed. However, imagine to place two rough back-scattering elements at the edges of the active material, similarly to the mirrors in a FP lasers but consisting of random distribution of scattering particles. Surprisingly , you will have typical random laser emission (so called "resonant" spectral signature) with the same spectrum from both back-scattering elements. This is the result we obtained in our group. I attach here the publication, and would appreciate comments and critics.
Article Decoupling gain and feedback in coherent random lasers: Expe...
Physics point of view, lasing is possible even without cavity, And engineering point of view it is highly beneficial to have a cavity at least for easy lasing, to avoid high pumping power, to avoid high temperature rise, etc.