A seismograph has two basic parts; an outer case that moves with the undulations of the earth, and an inner core that remains stable and records the earth's movements. Some seismographs are manual, but most now record the data electromagnetically.
A seismograph is made up of a supporting structure, and a free mass, or seismometer, inside the device. The supporting structure is securely mounted to the surface of the Earth.
When the ground moves during an earthquake, the structure moves as well. The seismometer is suspended inside the structure, and it does not move with the outer structure. This is what allows the seismometer to record the strength and undulations of the earth during the earthquake.
It was common for the seismometer to be a type of pendulum, with a type of recording stylus on the end. The pendulum would move with the movement of the earth, and the stylus would record the movement onto a revolving drum. Most people are familiar with the long sheets of paper that had zig-zag lines running across it. Those lines are from the stylus marking the movement.
Modern seismographs have been improved from manual to being an electromagnet. The seismometer, rather than being a stylus, is a large magnet. The support structure of the seismograph is wrapped with coils of wire, turning the device into an electromagnet. The movement of the earth creates small electric signals, which are recorded and then transferred to a computer.