who gave this law?
Rudolf Clausius
Second law of thermodynamics
Recognizing the significance of James Prescott Joule's work on the conservation of energy, Rudolf Clausius was the first to formulate the second law during 1850, in this form: heat does not flow "spontaneously" from cold to hot bodies. While common knowledge now, this was contrary to the caloric theory of heat popular at the time, which considered heat as a fluid. From there he was able to infer the principle of Sadi Carnot and the definition of entropy (1865).

is humpty dumpty an egg or a potato Egg what is this story or rhyme? Humpty Dumpty is a character in an English nursery rhyme, probably originally a riddle when was this nursery rhyme first published? 1797 how is this related to science? To demonstrate the second law of thermodynamics where the higher the entropy, the higher the disorder. After his fall and subsequent shattering, the inability to put him together again is representative of this principle what is the second law states? The  total entropy of an isolated system can never decrease over time, and is constant if and only if all processes are reversible.
wiki:18820000
Second law of thermodynamics [SEP] History
The first theory of the conversion of heat into mechanical work is due to Nicolas Léonard Sadi Carnot in 1824. He was the first to realize correctly that the efficiency of this conversion depends on the difference of temperature between an engine and its environment. Recognizing the significance of James Prescott Joule's work on the conservation of energy, Rudolf Clausius was the first to formulate the second law during 1850, in this form: heat does not flow "spontaneously" from cold to hot bodies. While common knowledge now, this was contrary to the caloric theory of heat popular at the time, which considered heat as a fluid.