what is a mezuzah used for
The mezuzah isn't 'used'. It's a small container that holds a rolled parchment on which are written a few biblical paragraphs. Jews mount it on the doorframes of their homes and shops to fulfill the commandment: These words that I command you today. . . . . you shall write them.