On the basis of density matrix formalism a mathematical model describing lasing in quantum well semiconductor nanostructures is developed. In its frame, an inversionless room-temperature operating amplifier or laser widely tunable in the far-infrared and terahertz (THz) region is suggested. Its working frequency can be varied by several times via the simple change of the mid-infrared pump power. For the pump beam intensity I = 2.9 × 107 W/cm2 the output frequency of such a device is expected to be ≃1.27 THz and the corresponding gain ≃0.73 cm-1. For I = 8.6 × 107 W/cm2 its working frequency is 1.9 times higher and the gain reaches 10.95 cm-1. The suggested amplifier or laser is expected to operate in the pulsed mode and to be used as a compact and convenient tunable source of the far-infrared and THz radiation for fundamental studies and various applications.