Costly signal is regarded as one of the mechanisms to explain the emergence of cooperation. Both the cost of cooperation and the cost of punishment can be seen as expensive cost signals. Previous research has used costly signaling theory to explain the establishment of cooperation and punishment in public goods game. However, punishment is less likely to emerge stably in the prisoner’s dilemma, and the punisher cannot have additional information to identify and punish the defector. Therefore, it is particularly important to further study whether the expensive cost signal in the prisoner’s dilemma can promote the emergence of cooperation and punishment. We distinguish between costly punishing signals and costly cooperative signals in this paper to look at the rule that turns payoff into fitness. The findings reveal that, without punishment, if the costly signal is weak and the cost of cooperation is not too high compared to the benefit of cooperation, cooperation is a better choice than defection. With punishment, if there is a small amount of noise in the costly signaling mechanism and punishment is considered a more expensive signal than cooperation, punishment is a better strategy.