While there is no record of when or how the forging process was “discovered” by humans, we can imagine the origins of the process. Liquid metals smelted from crude ores needed to be fashioned into more useful objects. Hammering the lumps of metal was the means to change them into more useful shapes.
There are some who still think forging is nothing more than “heat it and beat it” to make crude end products. This may have been the original concept but working metal into high quality products has been a hallmark of civilization for thousands of years.