What is a fruit?
Fruit is matured ovaries of a plant, containing the seeds of the next generation of plants.
Botanic fruit and Culinary fruit,
Is a tomato a fruit of a vegetable?
Many fruits that, in a botanical sense are true fruits and are actually treated as vegetables in cooking and food preparation because they are not particularly sweet. These culinary vegetables include squash, pumpkin, cucumber, tomatoes, peas, beans, corn, eggplant, and sweet pepper. In addition, some spices, such as allspice and chilies, are fruits, botanically speaking. In contrast, occasionally a culinary “fruit” is not a true fruit in the botanical sense. For example, rhubarb is often referred to as a fruit, because it is used to make sweet desserts such as pies, though only the petiole of the rhubarb plant is edible. In the culinary sense of these words, a fruit is usually any sweet-tasting plant product, especially those associated with seed, a vegetable is any savoury or less sweet plant product, and a nut is any hard, oily, and shelled plant product.
Technically, a cereal grain is also a kind of fruit, a kind which is termed a caryopsis. However, the fruit wall is very thin, and is fused to the seed coat, so almost all of the edible grain is actually a seed. Therefore, cereal grains, such as corn, wheat and rice are better considered as edible seeds, although some references do list them as fruits. Edible gymnosperm seeds are often misleadingly given fruit names, e.g., pine nuts, ginkgo nuts, and juniper berries.
The simple answer is, a tomato is a fruit.