Next I learnt about the question marker か and that it is primarily used to indicate a question in polite sentence, it is added at the end of the sentence and does not require a question mark.

Examples:

Q:お母さんはどこですか。- Where is (your) mother?

A:母は買い物に行きました。- (My) mother went shopping.

Q:イタリア料理を食べに行きませんか。- Go to eat Italian food?

A:すみません。ちょっと、お腹がいっぱいです。- Sorry, (my) stomach is a little full.

Next I learnt that it is not used the same way in casual speech but instead it is used to question whether something is true or not and can also be used to make rhetorical questions or express sarcasm.

Examples:

こんなのを本当に食べるか?- Do you think (he/she) will really eat this type of thing?

そんなのは、あるかよ!- Do I look like I would have something like that?!

Next I learnt about how to use か in relative clauses as a question marker attached to the end of a relative clause makes a mini-question inside a larger sentence.

Examples:

昨日何を食べたか忘れた。- Forgot what I ate yesterday.

彼は何を言ったか分からない。- Don't understand what he said.

先生が学校に行ったか教えない?- Won't you inform me whether teacher went to school?

For the third example where the answer can be yes or no I learnt it is common (but not necessary) to add どうか which is roughly equivalent to saying 'whether or not.'

先生が学校に行ったかどうか知らない。- Don't know whether or not teacher went to school.

先生が学校に行ったか行かなかったか知らない。- Don't know whether teacher went to school or didn't.