A hammer is a very useful tool to have—especially a claw hammer. A rubber mallet is a useful tool as well; however its uses are different than those of a traditional hammer. For example, driving a nail with a rubber mallet is a much different experience than driving a nail with a hammer.
WHEN TO USE A RUBBER MALLET RATHER THAN A HAMMER
However, there are some times when it might be better to use something else, such as a rubber mallet, rather than the traditional hammer.
Hammers are powerful, and can do serious damage, so if whatever you are hammering can be damaged easily, a rubber mallet may be a better choice.
One example is closing a paint can. When you close a paint can, you place the lid on and then hammer it down into place using a rubber mallet. You could use a hammer instead, but you would run the risk of bending or deforming the lid or the can. A rubber mallet provides enough force to seal the lid, but not enough force to damage it.
Another instance where a rubber mallet would be more suited to a job than a hammer is if you are trying to not make a lot of noise. Hammers are metal, so when they strike another metal object they make a lot of noise. If the job you are doing does not require the full force of a hammer, and you want to avoid making a lot of noise for whatever reason, a rubber mallet might be a better choice.
Driving tent stakes is a job where a rubber mallet could be used. The mallet will be strong enough to drive the stakes (unless the ground is extremely hard or dry) but the rubber head will make a lot less noise striking the stakes than a hammer would. Whether you are just being conscientious to those around you or you are trying to avoid attracting animals, a rubber mallet is a good choice to reduce the noise you’ll make.
A fourth reason to use a rubber mallet instead of a hammer is if you are working with children. Having a claw hammer around young children is not the best idea, but you could still allow them to help with building projects by using a rubber mallet. Many children would probably get just as much of a kick out of driving a nail (or anything else) with a mallet as they would with a hammer, and the mallet is a much safer option.