Upon use, repair hammers will eventually break at random, unless the user is a master armorer. The higher the player's armorer skill, the more likely the hammer will remain usable, otherwise it breaks. You can find repair hammers in boxes and crates located in many places, and they can also be purchased from merchants.
A tip for using repair hammers instead of taking your broken armour to a black-smith:
Go to the repair hammer menu, (pressing the repair hammer in menu) and press A on what you want to repair, then wait a bit until the "repair sound" ends and press A again. This will prevent the hammers from breaking as fast.
The Item ID is: 0000000C