I know that shift registers are used to extend the number of pins of the arduino.
I would like to know if a shift register like 74HC595 can be used for both analog and digital pins.
I also would like to know if it was possible to use it for input and ouput.
Parallel-in/serial out, and serial-in/parallel out, shift registers usually refer to digital functions.
The first is to capture the state of say 8 IO pins and read them in via SPI.transfer(), or shiftIn().
The second is to load up say 8 additional outputs via SPI.transfer, or shiftOut(), and have them drive current LED strings or similar.
Analog shift register are way less common, one that comes to mind is the bit-bucket chip that Radio Shack used in an analog delay line. Analog was sampled, passed along a chain, and came out the other end delayed from what went in.
Analog switches and multiplexers to have one ADC pin be able to read the level of many IO pins are common, see the 4067 mentioned above, others are DG406 and DG409.
Nowadays, an ADC would sample the data, store it, and some time later the sample would be written out to a DAC for playback.
This chip sampled the incoming charge, passed it across a series of storage cells, and then output it. Some loss of signal occurred as the charge was passed down the line.