The correct option is
D Maya Angelou said, "If you don't like something, change it. If you can't change it, change your attitude."
Option A - '
Maya Angelou said if you don't like something change it. If you can't change it, change your attitude.' is incorrect as the sentence is a direct sentence and it is not put in inverted commas. Thus option A is incorrect.Option B - Maya Angelou said if you don't like something change it. If you can't change it change your attitude? is incorrect as the direct sentence is not written in double inverted commas. Also, it is a simple sentence and not an interrogatory sentence, hence we can't put a question mark here. Thus option B is incorrect.
Option C - Maya Angelou said if you don't like something change it; if you can't change it change your attitude! is incorrect as the direct sentence is not written in double inverted commas. Also, it is a simple sentence and not an exclamatory sentence, hence we can't put an exclamation mark here. Thus option C is incorrect.
Option D - Maya Angelou said, "If you don't like something, change it. If you can't change it, change your attitude." is correct as we always write the direct speech in double inverted commas. Thus option D is the correct answer.