From where do we learn that Venishmartem meod lenafshtechem (devarin 4,15) means that we have to be careful with our lives. you don’t understand that from the pasuk. who was the first one to say it?
The first source discussing 'Venishmartem Me'od Lenafshoteichem' to being careful with our lives, is brought in the Talmud Bavli. Brachot 32b in the story about the Chasid who was Davening and did not return greetings to the minister who spoke with him. The minister then asked him, how is it he endangers himself as is forbidden - Venishmartem Me'od Lenafshoteichem. In the introduction to the book Shemirat Haguf VeHanefesh there is a long discussion whether Venishmartem is a Mitzvah from the Torah or a Mitzvah set by Chazal. Obviously, there is also the Isur of endangering oneself from the Mitzvah of building a fence on ones roof (Devarim 22:8). Rabbi Ro'i Margalit