You have asked a nice question. One can be said to be in the right path when these questions starts popping up.
Now, purpose is that thing for which one was created. It's the reason why why one finds himself or herself in the place where he or she is.
No one was born just to fill the space on the earth. For everyone on the earth, there is something they have come to fulfill. It's saddening to know that many don't find it till they die. Some found it and were in the process of working towards it when they left, some never find it and yet, there are those who don't even realize that they have a purpose.
Now, to your question. Knowing your purpose requires diligent search. You'd have to pray about it and ask the creator to reveal it to you. Also, there are cards that should help you reveal your purpose. By cards, I mean signs, indicators that points to one's purpose.
First, your purpose is usually tied to the things you're like doing, things you have a natural inclination towards. Doing these things comes easy to you and there is hardly any struggle on your part to achieve this.
Secondly, your purpose is tied that thing you get angry about when you see it done the wrong way. You wish you could be there to be doing it through right way.
Also, your purpose is tied to that thing that when done brings fulfillment to you. You are happy every time the need arises to do that thing.
With these, you can identify your purpose without much hassle.