ROM is memory you only read while the system is running. Its contents are put in beforehand, when the chip is made or programmed, and they survive with the power off: ROM is non-volatile.
Typical uses:
- the start-up program a computer runs when switched on (the firmware)
- fixed tables, such as character shapes or the segment patterns for a display
- any combinational function, used as a lookup table
Inside, a ROM is a decoder plus OR gates. The address goes into an address decoder, which activates one word line. Each data bit is an OR gate, and a stored 1 is simply a connection from a word line to that OR gate. That is exactly the decoder implementation of a set of functions, built in bulk.
That's also why a ROM can implement any n-input, m-output function: wire the inputs to the address lines and store the truth table. It needs 2ⁿ words of m bits. Each extra input doubles the size.
"Read-only" has loosened over time. The ROM family runs from mask ROM (fixed forever) through PROM, EPROM and EEPROM to flash, which can be rewritten in place.