How Can Something Be a Fruit and a Vegetable?
This confusion stems from a misunderstanding of terms. People are conflating the two definitions of fruit. Fruit has both a botanical and a culinary definition.
Something may technically be a fruit by the botanical definition but be a vegetable by the culinary definition. That's what happens with all of the confusing items like cucumbers, corn, and tomatoes. This makes it technically both.
Botany is the scientific study of plants. Magirology/the culinary arts relate to cooking/preparing food. A botanist classifies plant parts based on how they are grown by the plant and what purpose they serve for the plant. A chef would classify plant parts based on how they taste and what purpose they serve in a meal. Most people have much more in common with the chef than they do with the botanist. When you classify a zucchini, you are caring about how it tastes or how people would eat it. No one really cares where on the plant it came from.
Unless you are a scientist studying botany, you are unlikely to care what something is botanically. In everyday speech, you should call these "confusing" foods "vegetables" because that's what they are practically. People may say that they are "actually fruits"—and they would be right if you are talking about the different parts of a plant and its flower or something. But if you are talking about them as food, calling vegetables "fruits" is wrong. The botanical term just has no usefulness, so throwing it in food discussions is being purposefully obtuse. Certainly, mixing the botanical term "fruit" with the term "vegetable" is wrong. They are describing different things.
"Science" does not say otherwise. For one, botany is just one field of science. There is also such a thing as culinary science. Second though, names are not a core part of science. You cannot test and reproduce the results of naming something. They are just names people attached to different concepts they made up to make keeping track of them easier. Nothing about what botanists call parts of a plant should influence your cooking.
So what is a "fruit" then?
What makes something a "vegetable"?