There are two types of inverted commas, Single inverted commas, (' '), also called Single Quotation Marks, and Double Inverted Commas, (" "), also called Double Quotation marks.
There is some confusion about how they should be used because they are used differently in the UK and the US.
There are basically three reasons to use either one of these: to identify the exact words in direct speech; to identify a quote within a quote; to identify a special word.
When someone speaks, the punctuation is part of the sentence, so a question mark is part of the question. The inverted commas are not, because they are there just to show the reader what the direct speech was. For this reason, all punctuation goes between the inverted commas.
"Have you seen my keys?" he asked. - correct
"Have you seen my keys"? he asked. - not correct
Quote within a Quote
If you have a quote within direct speech, you need to identify the difference between the two, and this is done by using Double inverted commas for the direct speech, and the Single inverted commas for the quote.
"Did david say 'I don't care' yesterday?"
So the single inverted commas are used here to avoid confusion.
They are also used to identify special words, and here the British use single inverted commas, and the American use double inverted commas, so it doesn't matter which ones you choose.
I had a visit from my "friend" the tax man.