Yes, that works. Congratulations for finding two cards that work so well together. It's not legal in Standard but it is in other formats (e.g. Modern). There are no rules for which cards are allowed in casual games, it's just what you agree on with your opponent(s).
Note that you can't gain infinite life, as stated in the title; you can gain as much life as you want. E.g. you can declare that you want to execute the loop (tapping the Paladin with the ability it gained from the Mentor) one million times, and you end up with one million extra life. If your opponent has an 'infinite' damage loop, they'll be able to execute theirs for a larger amount than one million and still kill you. They'd be advised to kill your creatures first, otherwise you can respond to their loop iteration with another activation of the Paladin's life-gaining ability.