It depends who you ask. Your local greengrocer probably doesn't think of a coconut as a fruit but most dictionaries say that for something to be considered a fruit it has to meet two criteria:
Firstly, it has to be the part of a plant which contains the seed(s);
Secondly, it has to be edible.
By this definition, ALL edible nuts are fruit.
Well, all nuts are fruit, but not all fruit are nuts so (f we are all agreed that it is "a product of a fertilised ovary")... the only question we need to ask is whether it is a nut or not. The dictionary definition of a nut is a "dry, indehiscent, single-seeded fruit with a hard woody wall" and I guess coconuts just aren't dry. So it's a fruit.