The context and the character of the participants makes it very clear
Note, as far as I recall the viewer never gets a glimpse inside the box, so, in one sense, the movie deliberately withholds evidence from the viewer. This might leave you doubting that Jon Doe had murdered Mills' wife.
But the context of the scene does not. We know the characters of the individuals: John Doe is clearly capable and motivated to commit the murder and, to make his epic point, he has to commit an act capable of inciting Mills to the sin of Wrath; Somerset has a deep understanding of human motivation and the specific pattern of Doe's crimes; Mills is in love with his wife and is not such a poorly controlled cop that he would react with vengeful wrath to many insults.
The scene plays out with Somerset opening the box. Somerset's reaction to seeing the contents suggests he knows immediately what Mills will do. He attempts to stop Mills obvious action by persuading him to disarm before looking in the box. What other possible content in the box could cause this reaction? Mills then looks and reacts with vengeance. What else could have persuaded him to do so? Mills has seen other atrocities committed by Doe and did not react this way.
The only possibility here is that Doe has done what he claimed and the box contains Mills' wife's head. The fact it is not shown explicitly actually makes the climax more tense. You don't need to see everything to know what has happened (subtlety is good and treats audiences as intelligent people).