Nimm einen Apfel.
Take an apple, okay I think I know, but why einen Apfel?
Because feminine nouns do not change articles for accusative case. Die Speisekarte is the direct object, where ich (mir) is the beneficiary of the verb zeigen. Zeigen is a transitive verb, which is a type of verb that has a direct object, die Speisekarte, in this case.
What are you showing? Die Speisekarte. (accusative, article does not change for feminine nouns)
Who are you showing the menu to? mir = to me (dative case). "I" am the beneficiary in this case, "I" have the benefit of being "shown" the menu. Same with words like "geben". Whomever receives the direct object (accusative) is the beneficiary (dative). Wir geben dem Mann einen Apfel. "Dem Mann" (dative) is given "Einen Apfel" (accusative).
"Whom" is actually a "dative case" in English.
"I sent a letter." "To whom?"
For "Nimm einen Apfel", the direct object of nehmen is the apple, the thing that is being taken. This is the accusative case, hence einen Apfel (since masculine articles change in the accusative case).
A general rule of thumb for distinguishing between accusative and dative is that the accusative usually implies movement while dative implies a static action, if that makes sense.
For example, the difference between "liegen" (to lie) and "legen" (to lay):
Ich liege auf dem Tisch. = I am lying on the table./I'm on the table.
Ich lege mich auf den Tisch. = I lie myself (down) on the table.
The difference is that the first sentence describes a passive statement; I was already lying on the table. The second describes the current action of literally putting myself on the table (for instance, it had been a long day!). "Mich" is specified here in the accusative case since I am the object to be laid on the table, and table is also accusative since it is the resulting place of an action. (Note that 'auf' is one of those tricky two-way prepositions)
I don't know if I'm making much sense here but that is how I've thought about those two cases. Of course it's best to know which case specific verbs force but I've seen that "action rule" as a decent way to understand why, usually.
die Speisekarte is a feminie noun. feminine nouns stay die in Akkusativ and Nominativ.
here i have table for you which shows how article change acording to the cases. it is in german though.