You may find someone who will tell you the answer is X, and another that tells you it is not at all X, but Y. who is right?
Someone may tell you that there is no absolute goal of life — that each of us needs to define our personal goal and give meaning to our life.
Someone else may tell you that is nonsense since evolution compels us to believe that reproduction is the goal of life. Should we believe him because he is a scientist? but what if he is a bad philosopher?
A philosopher may tell you that many philosophical questions have no definite single right answer, and their value is in thinking about them rather than finding a final answer.
Yet another philosopher might argue that is is a nonsensical question, the result of a psychological compulsion to abuse language and concepts like life and meaning in ways that they are not actually used in everyday language.
Someone else may tell you that the goal of life is realizing the existence of God. Should we listen to him because he is old and wise? because he seems to be an authority?
Someone else may say that there is no purpose to life.
Finally, someone may tell you that there does not seem to be an absolute answer to this question. Should we believe him because it is all indeed very confusing?
Who is right? all of them? neither one?
Nevertheless, it is a question that we can continuously think about and examine, just like Socrates preached examining life itself.
Your teacher may knows all this, but I think he was wrong in rejecting your proposal as he did. If someone believes in the afterlife, preparing for it seems like an arguably reasonable purpose in life. And even without an afterlife, coming to terms with the inevitability of our death and preparing for it psychologically may be a purpose of life.
Here is Woody Allen's funny take on this: https://www.youtube.com/watch?v=2MsuqvLIttk
And here is another less gloomy version in which he essentially preaches life should just be lived and enjoyed: https://www.youtube.com/watch?v=uYZsApGC0BE