It may be a formulaic knockabout comedy, but beneath the surface of this early Jim Carrey outing lurks a compelling honesty – and an important life lesson, writes Tom Lamont