Pineapples are definitely fruits. They are very sweet and often eaten as a type of dessert. They are most commonly eaten raw, like most other fruits, but they are sometimes grilled first. However, this only seems to make them even sweeter and more delicious somehow.
Sometimes they are put on otherwise savory foods like hamburgers or pizza, but this is in contrast to the savory flavors. It isn’t used as a savory flavor itself like tomatoes or olives might be.
Botanically, they are impliedly also fruits. They are interestingly what are called multiple fruits because each pineapple is formed by the fusion of many small pineapple flowers. Each flower produces its own botanical berry. Then over a hundred of these “berries” all merge to form a single pineapple fruit.
Note that this doesn’t make the pineapple a berry in the culinary sense of the word either. Botanically it’s many, many “berries” merged to form one multiple fruit, but this isn’t the same meaning of the word as we typically use it to mean a small, soft fruit typically eaten whole. Pineapples are huge, aren’t the softest inside, and have a thick, spiky skin that I would greatly discourage people from trying to eat. Pineapples are not berries as we understand them.