A transfer function H(f) describes the output of a system for any input at frequency f. It has two components: magnitude (how much the amplitude changes) and phase (how much the timing shifts). The goal of room correction is to measure the room+speaker transfer function and design an inverse filter that makes the total transfer function flat.
Transfer functions are measured by comparing the input signal (sine sweep, pink noise, or impulse) to the recorded output. The difference is the transfer function. Modern measurement software (Room EQ Wizard, ARTA, SMAART) automates this process.