This is called a water hammer this is used in pipe lines around your house.
They all don't look like this, this a water hammer for a washing machine.There is different looking ones, it depends on where its being used.
This is made of glass, inside it is water only.
You know when you jump on the surface of water , it may harm you , because of the same reason.
You can listen to the sound it makes from the videos down below