1. If an IELTS candidate writes an essay that they remembered from a book, will it be considered plagiarism?
It is unlikely that you will be able to use an exact essay from a book because IELTS questions are always a bit different from questions that have been used before. I don't recommend memorising full essays; it's much better to learn a few key ideas, and to make sure you have an opinion about the most common IELTS topics.
2. Which is correct: "years old" or "year-olds"?
Both are correct, but they are used differently. We can say: "the children in the class are all 8 years old" or "the children in the class are all 8-year-olds". It's important to note that "8-year-olds" is a noun and can be used at the start of a sentence (e.g. "8-year-olds like playing games"), but you can't do this with "8 years old" (you would need to write "children who are 8 years old like playing games").
3. How will I know if I'm using correct phrases and collocations?
The only way to be sure is to check in a dictionary or to use a search engine like Google. For example, if you want to know whether we say "8 years old" or "8-year-olds" try googling them (with the speech marks); you will find good examples of each phrase.
PS. Yes, "google" has become a verb!