Even though "think" is generally translated to "penser", I think here, it is better to use "réfléchir", which is more deep.
- Avez-vous déjà réfléchi à cette question,
Also for "the purpose of life" there is an expression which is
- quel est le sens de la vie ?
So sense is used instead of purpose, if you want to use purpose I think the suggestion by Marlon is great, "existence" fits better here than "vie", as in Aysel suggestion.
- quel est le but de l'existence ?
( REM: It is not to be mistaken with "what is your goal in life ?", which has a different meaning
- quel est votre but dans la vie ? )
Another expression is common, but it sounds slightly pessimistic or nihilist.
- à quoi ça sert de vivre ?