In the Baroque Cycle (historical fiction), there's a scene where a politically connected young lord picks a fight with a trinity college steward attempting to stop his friend from bringing a prostitute on the grounds. The lord essentially forces the steward to duel him by threatening to kill him if he doesn't defend himself, promptly kills him, hides the body, and then extorts silence from the protagonist by pointing out, among other things, the impossibility of proving a murder and not a duel.
Were duels legal during this time period? And if so what stopped people from falsely claiming mutual combat after the fact when they had just murdered someone?
In regards to legality, that depends on the country, but during the renaissance most looked on it as a gentleman's way of resolving disputes, and you wouldn't always be punished.
in an eighteen-year period" while a twenty-year period of Louis XIII's reign saw some eight thousand pardons for "murders associated with duels
-Ariel Roth
Now, in regards to how you would do it, that depends. Sometimes you would go to a pre agreed upon area and fight each other, other times it could be a spur of the moment type thing. Generally, each person would have a second. A person, usually a friend, who would fight the duel if the first could not, but a second's first job was to try to get their friend to come to their senses and stop.
In regards to how you would be looked upon, well, just look at the duels between Francois Fournier-Salvorez and Pierre Dupont de l'Étang. While both officers in Napoleon's grand armée, they fought a series of duels spanning several years. To quote Nick Evangelista in his Encyclopedia of the Sword,
As a young officer in Napoleon's Army, Dupont was ordered to deliver a disagreeable message to a fellow officer, Fournier, a rabid duellist. Fournier, taking out his subsequent rage on the messenger, challenged Dupont to a duel. This sparked a succession of encounters, waged with sword and pistol, that spanned decades. The contest was eventually resolved when Dupont was able to overcome Fournier in a pistol duel, forcing him to promise never to bother him again.
Now, Dupont became a general and served several more years after Napoleon fell, still as a general.
Fournier was known as the worst subject in Napoleon's army, and was hated for his love of, and frequent dueling.
While he was never expressly punished by law, he was vilified by other officers and was removed from his post several times.
Moreover, if you kill a man, his relatives might come searching for vengeance.
Basically, while you might not always get punished by law, there would be consequences.
Hope this helps!
Apologies for being a bit busy right now so I can't write a proper answer, but this compiliation of Dueling answers should likely be of interest for you, as the questions you pose here are answered there. Happy to take follow ups best that I can later.