Is it always forbidden to swear to G-d, or does it depend on truth? I read somewhere that "in vain" means for something false or obvious. If someone doesn't believe me about something very important and asks me to swear to G-d, am I allowed?
The Seventh of the 613 Mitzvot according to the Rambam is:
והמצוה השביעית היא שצונו להשבע בשמו יתעלה כשנצטרך לקיים דבר מן הדברים או להכחישו כי בזה הגדולה לשם יתע' וכבוד ועילוי והוא אמרו (ואתחנן ו עקב י) ובשמו תשבע...
The seventh commandment is that we are commanded to take oaths in His holy name when we will need to establish or contradict something, for in this manner it is an honor to God [to use His name] as it says (Devarim 6:2) "And in His name you shall swear"...
So yes, there definitely are times to take oaths and there is even a mitzva to do so with God's name when one is taking an oath.
HOWEVER, I strongly caution against taking oaths unless absolutely neccasary as they are not undoable, and the punishment for breaking one is very strong. In the third of the Ten Commandments God himself says (immediately after the prohibition on idolatry) that he will not forgive one who takes his name in vain. So this is not something to be taken lightly.
Note that the Ramban in his critique of the Rambam's count argues that swearing with God's name when neccasary is not an obligatory act (חיוב) but rather an optional act (רשות). But even according to him it is permitted.
As @DoubleAA wrote, the Rambam seems to imply that there is a mitzva to swear in Hashem's name (when something is true).
However, there is a Medrash Tanchuma which says that since the verse says: "את ה' אלהיך תירא ואותו תעבוד ובו תדבק ובשמו תשבע" - "You will fear Hashem, serve him, cleave to him and swear in his name", one is only allowed to swear in Hashem's name if
- He fears Hashem like Avraham, Job and Yosef.
- Serve Him - serves only Hashem and doesn't work for anyone else.
- Cleave to Him - marries his daughter to a torah scholar and does business for him.
(my question - how does point 2 and point 3 work together).
Moreover, the Midrash says that King Yanai had 2,000 villages destroyed because people swore truthfully.
Therefore, the Ramban interprets this verse to be a "Lav habah miklal asey" - a negative commandment that was said in a positive form (that one is prohibited to swear in the name of idols).
There is an argument as to the practical opinion of the Rambam - Does he follow his opinion in the Sefer Hamitzvos or does he say that it is just permissible to swear in Hashem's name (it implies in the Mishna Torah that one is permitted to swear truthfully.
The Minchas Yitzchak, however, explains that there is no contradiction between the Rambam and between the Rambam and the Braisa. He explains that there are three circumstances under which one can take an oath:
- No need - Forbidden
- When there is a partial need - to obligate oneself to do something (like to say "I will go to ...") - permissible
- When one swears for a need (to establish something he said as true)- it's obligatory.
The Chasam Sofer says that one is forbidden to take an oath even if true, and his source is a verse in Koheles which says "All things come alike to all; there is one event to the righteous and to the wicked; to the good and to the clean and to the unclean; to him that sacrificeth and to him that sacrificeth not; as is the good, so is the sinner, and he that sweareth, as he that feareth an oath."
He asks what does the one who "swear"s and one who "fears an oath" swear about? If it was referring to a false oath, it would have been included in the previous line of "the good... the sinner". Rather, it must refer to the prohibition to swear truthfully.
As someone who has studied Tractate Sh'vuos, there are actually situations where you must given testimony if you can.
(I will enlist some of the situations and the appropriate dafim in Sh'vuos as my source. These are undisputed other than some of the detail).
Although we still have Beis Din nowadays ruling in civil cases, they are not as authoritative as they used to be in generality, and therefore I do not think we still take these oaths, so someone with better knowledge will have to fill in the detail.
RE: "UVISHMO TISHOVEYAH In His name you shall swear.". The problem with swearing with the Divine Name is that if you are asked to swear for a serious matter, as in a dispute with one's spouse, the next time you may be ask to do it for a less serious matter, and finally for a trivial matter. Thus, it is best not to embark along this path, but if the need to reestablish SHOLEM BAIS is urgent,then it should be done with great solemnity, perhaps in the presence of a religious authority. Also, TORAH imposes two conditions on the one who would swear-that he be G-D fearing (respecting) and that he serve G-D but the manner of that service is a matter to be dealt with elsewhere. The Medrash Tanchuma adds ""He should cleave to him" for which I find no justification. But the one condition that I would cite as essential is that the swearer be swearing to the truth.
Forgot exact page and don't know original source, but it says on Likutei Torah (or Torah Ohr) that when one takes an oath, even a true one, he draws upon himself a certain level of the ohr ayn sof -- (G-ds) never ending light, and back in the days of the holy Temple and tanaim, they were able to handle that sublime level being drawn down upon them, but nowadays we are all on a much lower spiritual level, so we are forbidden from making any oath of any form (so as not to draw down that sublime level of hashem that we can't handle), and instead must say "bli neder" (although there are difference between vows and oaths, not sure if the same logic applies to both actually)