Yes, cucumbers are botanically a fruit. While they are probably one of the last plants that we would think of as a “berry,” that is what they are botanically (specifically, the botanical subclassification of “pepo”) because they have seeds inside them, are fleshy, were made from a single ovary, and don’t split open to spread their seeds everywhere. This definition just largely independent from our everyday culinary definition.
In the culinary world, they are obviously considered to be vegetables. They are mainly eaten in leafy vegetable salads, not fruit salads. If you put cucumbers in your berry pies, you should probably be committed.
How can something be both a fruit and a vegetable?