At the start of the play, Gerald Croft comes across as a very confident character, very much the archetypal rich young man about town. A life of wealth and ease has given him a sense of entitlement, which leads him to treat those he deems to be his social inferiors with disdain. One such "inferior" is Eva Smith, with whom Gerald conducts an illicit affair. The revelation of her death unsettles Gerald, undermining his normally rock solid self-confidence. For the first time in his life, he's been presented with a problem that can't easily be fixed or brushed aside. As he's engaged to Sheila Burling, Gerald knows that he must do whatever he can to avoid the scandal that would inevitably arise were his involvement with Eva Smith to be made public.
As the play progresses, however, Gerald moves his attention from trying to cover-up his affair with Eva to facing up to it. He openly acknowledges the affair and his subsequent abandonment of Eva, revealing a previously hidden side to his personality, an emotional maturity long buried beneath the brash, confident exterior. It's clear from Gerald's tearful confession that he did harbor genuine feelings towards Eva and really did want to help her out as best he could. But towards the end of the play, he reverts to type in trying to expose the Inspector as a fraud, thus getting himself and the Burlings out of a jam. It would seem that Gerald hasn't really changed after all. What Priestley appears to be saying here is that, when push comes to shove, the upper-classes will always circle the wagons and protect each other, always put themselves and their own narrow interests ahead of others.