Is corn a fruit, vegetable, or a nut?
Corn (Maize) is clearly a cereal grain, and not any of the other things you mention. Even the farmers and agricultural agencies consider it a grain - it's one of the "official grains of Canada" and regulated by the Canadian grain commission.

I'm not sure when or why it started being called a vegetable, but as far as the culinary definition goes, it has far too much sugar and starch to fall properly into that category. The typical culinary definition of a vegetable is savory, not sweet.

Botanically, the kernels can be considered a type of fruit called a caryopsis (AKA a grain), although it's not normally eaten as fruit (for one thing, it's normally cooked).

It may accompany vegetables reasonably well, just like rice or many other grains. But it is a grain.