Question: In this sentence: 做乜唔叫埋我? What is the function of 埋?

I understood this sentence to be: "why didn't you call me?" (perhaps to an outing or a party). What is the difference with the sentence "做乜唔叫我"?

Insights please.

Answer: 
做乜唔叫埋我? What is the function of 埋?

First the sentence reads as:-

做乜 = why, (for what reason)

唔叫 = didn't call, (didn't include)

埋我? = me as well?

The function of 埋 in this context of Cantonese speech is not "bury" but to mean "as well"

So, 埋我 means "me as well"

Of course in Cantonese 埋 also means "bury" in some other context.

Another example of 埋 is 請埋位食饭 = please take a seat for (food, dinner, etc), where 埋位 means "take a seat", and not "bury a seat" in this context.

From these basic examples, it could be seen that 埋 has multifarious usages in Cantonese speech, and only the context would ferret out the applicable meanings and usages.

Finally, Quote:- "What is the difference with the sentence "做乜唔叫我"?"

The "difference" between 做乜唔叫埋我? and 做乜唔叫我? is the "tone", meaning the intention behind the question.

In 做乜唔叫我?, it is more a straight forward, neutral inquiry.

In 做乜唔叫埋我?, the 埋我, "as well", has an "accusative" element, a certain covert unhappiness of "being left out" This accusative element could also be implied in the equivalent English sentences -- "Why didn't you call me"? and "Why didn't you call me as well"?

This accusative element is more pronounced if 唔叫 is translated as "not include" rather than "not call" because in Cantonese 叫 in certain context does not always mean "call", (as in call someone on the phone)
做乜唔叫我？ => Why didn't (you) notify me?

做乜唔叫**埋**我？ = 做乜唔預我？ = 做乜唔邀請我？ => Why didn't (you) **also** count me **in**? = Why was I kept out? = Why ain't I **also in**vited?

In English, "**also** count (somebody) **in**" means "**in**vite (somebody) **too**", but "count (somebody)" alone has no such clear meaning.

While both questions sounds accusing, 埋 emphasizes that at lease one person is included in an event yet the asker was kept out.