Self-aware individuals are more likely to consider whether their actions are appropriate in terms of public self-consciousness, and to use that information to execute behaviors that match external standards and/or expectations. The learning concepts through which individuals monitor themselves have generally been overlooked by artificial intelligence researchers. Here we report on our attempt to integrate a self-awareness mechanism into an agent's learning architecture. Specifically, we describe (a) our proposal for a self-aware agent model that includes an external learning mechanism and internal cognitive capacity with super-ego and ego characteristics; and (b) our application of a version of the iterated prisoner's dilemma representing conflicts between the public good and private interests to analyze the effects of self-awareness on an agent's individual performance and cooperative behavior. Our results indicate that self-aware agents that consider public self-consciousness utilize rational analysis in a manner that promotes cooperative behavior and supports faster societal movement toward stability. We found that a small number of self-aware agents are sufficient for improving social benefits and resolving problems associated with collective irrational behaviors.