What is the purpose of a transistor?

A transistor is a semiconductor device which is commonly used to amplify or switch electronic signals. A transistor is made of a solid piece of a semiconductor material, with at least three terminals for connection to an external circuit. It is used as a switch or a signal amplifier in a circuit.