Consider this example:
That 'that' that that guy used was ungrammatical.
The four instances of "that" are all grammatical, but have different functions/meanings. What is the function/meaning of each "that"?
English Language Learners Stack Exchange is a question and answer site for speakers of other languages learning English. It only takes a minute to sign up.Sign up to join this community
It may be difficult for non-native English speakers to even understand the question (which is important since StackExchange is intended to be a resource). So let's build up the semantics one "that" at-a-time, which, incidentally, will also answer the question.
1st That: That flower looks pretty. The first that is a demonstrative determiner, indicating which flower is being talked about.1
2nd That: That "that" should be capitalized. The second that is simply a reference to the word itself, so it is a noun. For example, consider the following incorrectly capitalized sentence written by some student in a paper: John thought, "that is interesting." A teacher, talking to the student, might point her finger at the word 'that' and say, "That 'that' should be capitalized."
3rd That: That milk
that he used is sour.2 The 3rd that is a relative pronoun introducing a relative clause. Note that one can often remove that when used as a relative clause: That milk he used is sour. (See also, https://english.stackexchange.com/questions/104512/is-this-a-relative-pronoun-or-conjunction.)
4th (last) That: That "that"
that that guy used is ungrammatical. Here we can see the last that is again a determiner, indicating which guy is being talked about. We can also eliminate the 3rd that (the relative pronoun): That "that" that guy used is ungrammatical.
Note that, when spoken, the different that's are emphasized through varying volume and pauses. Here's an approximate description: (Normal) That (louder and lyrical like two syllables) THAT (very short, like it's connected to the next that as one word) that (normal but louder than the first that) that guy used is ungrammatical.
1. The Demonstrative determiners are also popularly called demonstrative adjectives. The latter nomenclature might have evolved as a mix of terms or a misnomer, but it's popular enough that it will likely remain in print (and on the Internet) for a long time. See https://english.stackexchange.com/questions/61456/use-of-determiners-as-adjectives/61470#61470 and http://www.lel.ed.ac.uk/~gpullum/grammar/detv_sli.pdf.
2. I've highlighted all instances of the relative pronoun 'that' with
grey background so one can easily see where-it-is and where-it-isn't.