The confusion about 'fruit' and 'vegetable' arises because of the differences in usage between scientists and cooks. Scientifically speaking, a tomato is definitely a fruit. True fruits are developed from the ovary in the base of the flower, and contain the seeds of the plant (though cultivated forms may be seedless). Blueberries, raspberries, and oranges are true fruits, and so are many kinds of nut. Some plants have a soft part which supports the seeds and is also called a 'fruit', though it is not developed from the ovary: the strawberry is an example.
As far as cooking is concerned, some things which are strictly fruits, such as tomatoes orbean pods, may be called 'vegetables' because they are used in savoury rather than sweet cooking. The term 'vegetable' is more generally used of other edible parts of plants, such as cabbage leaves, celery stalks, and potato tubers, which are not strictly the fruit of the plant from which they come. Occasionally the term 'fruit' may be used to refer to a part of a plant which is not a fruit, but which is used in sweet cooking: rhubarb, for example.
So, the answer to the question is that a tomato is technically the fruit of the tomato plant, but it's used as a vegetable in cooking.
Hope this helps :)