Yes, the fruit of the Peruvian apple cactus (Cereus repandus or Cereus peruvianus) is completely edible and quite tasty.
Flavor & Texture: The inner pulp is white or pale pink, filled with tiny, crunchy black seeds. Its texture and appearance resemble dragon fruit or kiwi, with a mild, delicate sweetness often described as a mix of pear, melon, and cane sugar.
Spines: Unlike prickly pear (Opuntia) fruit, the fruit on a Peruvian apple cactus is thornless and smooth on the outside, making it easy to harvest and handle without worrying about glochids (tiny hair-like spines).
When to Eat: The fruit in the image is still developing behind the spent flower bloom. It will swell into an apple-sized oval and turn a vibrant magenta, reddish-purple, or yellow-orange as it matures. It is ready to pick once it fully colors up and softens slightly (often splitting open naturally when dead ripe).
How to Eat: Slice it open lengthwise, discard the outer peel, and scoop out the pulp and seeds with a spoon. It is best eaten fresh and chilled.