1. I am a dentist, am I not?

2. I am a dentist, aren't I?
3. I am a dentist, ain't I?

(Which one is grammatically correct?)

1 and 2 are correct; 2 is the most commonly used. 3 is substandard English.

Out of the three options you provided, the first one is grammatically correct: "I am a dentist, am I not?" This sentence follows the standard English structure for forming a negative question.

To understand why this is the grammatically correct option, let's break it down:

1. "I am a dentist" is a positive statement indicating that you are indeed a dentist.
2. "Am I not?" is a negative question formation. When forming a negative question, we generally use "not" after the auxiliary verb (in this case, "am") to indicate the negative form.

As for the other options:

2. "I am a dentist, aren't I?" is a common informal usage, but it is considered grammatically incorrect because it violates the rules of subject-auxiliary inversion. "Aren't I?" should be used when the subject is "I" in an affirmative statement (e.g., "I am happy, aren't I?").

3. "I am a dentist, ain't I?" is also considered grammatically incorrect. "Ain't" is a non-standard or dialectal contraction of "am not," "are not," or "is not," and it is generally avoided in formal English.

In conclusion, the grammatically correct option is: "I am a dentist, am I not?"