I read in a sefer that we are not supposed to serve Hashem with the intention of getting reward. So what should a person do if he feels that he does mitzvos only for reward?
He should continue to do more mitzvos. And more and more. It’s a good investment, no question about it. A very good investment. Only that you have to know, that along with that investment, you are working on yourself and you’re changing your character.
That’s what הקדוש ברוך הוא wants from you. קדושים תהיו is a מצוה כללית, it’s a general mitzvah that applies to everything you do. The more mitzvos you do, the more קדוש you become. Your character is changing for the better and you are perfecting yourself. Every mitzvah that you do, you are walking in the ways of Hashem. והלכת בדרכיו. You should emulate Hashem by walking in His ways. The more you walk in His ways, the better you become.
Nobody said you should stop doing mitzvos for the purpose of reward. Don’t listen when it says אל תהיו כעבדים המשמשים את הרב על מנת לקבל פרס – “You should not be like a servant who serves his master to gain reward” (Avos 1:3). It’s a big mistake to listen to that. What that means is don’t serve Hashem only for the purpose of reward. That shouldn’t be your only intention when you are doing mitzvos, when you are serving Hashem. You have to add in the thought, “I’m serving You Hashem because I owe it to You for all that You’ve done for me.”
But in any case, always do mitzvos even though you want reward. And it’s true, you’ll get a great reward. It’s a very wise investment indeed.