At some point after Spock becomes the captain but before Kirk does, he gives an order to Chekov who replies "Aye, Commander", then immediately corrects himself, saying "Ah! Captain, sorry, captain". Although Spock was in command and was made "the captain" by Pike, he still retained the rank of commander. Was Chekov wrong, in the sense that he could have been reprimanded as per Starfleet regulations, for calling Spock "Commander"?
Commander and Captain are (in current Naval practice) both ranks, but "Captain" is a job. One can be "the Captain" (commanding officer) without holding the rank of Captain (JFK was captain of a PT boat while holding the rank of LT). However, for clarity and courtesy it is the practice to refer to the Commanding Officer as Captain regardless of rank. Chekov had made an understandable mistake, but it is not likely to result in a reprimand (repeated misaddressal might lead to reprimand and charges).
Quote from Wikipedia (itself paraphrasing The Naval Officer's Guide):
Any naval officer who commands a ship is addressed by naval custom as "captain" while aboard in command, regardless of their actual rank, even though technically an officer of below the rank of captain is more correctly titled the commanding officer, or C.O. Officers with the rank of captain travelling aboard a vessel they do not command should be addressed by their rank and name (e.g., "Captain Smith"), but they should not be referred to as "the captain" to avoid confusion with the vessel's captain
Per the Manual for Courts-Martial (IV-21, paragraph 15; p. 329 of the PDF), the elements of Article 89 (Disrespect to a Superior Officer) are:
- Disrespect toward superior commissioned officer.
- (a) That the accused did or omitted certain acts or used certain language to or concerning a certain commissioned officer;
- (b) That such behavior or language was directed toward that officer;
- (c) That the officer toward whom the acts, omissions, or words were directed was the superior commissioned officer of the accused;
- (d) That the accused then knew that the commissioned officer toward whom the acts, omissions, or words were directed was the accused’s superior commissioned officer; and
- (e) That, under the circumstances, the behavior or language was disrespectful to that commissioned officer.
Note, I am assuming that US Navy practices carry forward to Starfleet - but Roddenberry's rules for believability state that if you can't imagine a good current US Navy officer doing something, then it shouldn't happen in Star Trek.
DAX: Are you two ever going to be finished?
NOG: Just a few more minutes, Commander.
O'BRIEN: That's Captain. It's an old naval tradition. Whoever's in command of a ship, regardless of rank, is referred to as Captain.
The fact that O'Brien calls it a tradition, and not a regulation, indicates that there probably would not be any punishment for Nog calling Dax 'Commander'.
A clip can be seen here: