How much longer will my 10 year old frame last? My friends say it will last forever, and not to worry about it.
Online results show anywhere from two years to 25. I have no clue what to expect!!

Let me give some context. I bought a decade old Specialized Epic Comp for about $550. There are no real problems with it. I needed to bleed brakes and replace the rear wheel, but that's beside the point.

The m5 alu frame shows no signs of fatigue (eg, no cracks, dents, etc). Based on what the previous owner told me, I calculated that he has probably rode about 45 000 km on this bike.
Note that this an XC bike so I don't assume that there would have been much opportunity to abuse the frame.

So with all of this in mind, can anyone give me a rough estimate of how long this 10 year old bicycle frame might last?

Sorry if this question is too vague/specific or already answered to a degree. Im new to this forum .
The slightly sarcastic-sounding comment is correct, unfortunately.

Even if you used a high-end xray imaging system to carefully analyse the frame, the best you could say is "there are no obvious defects found". You might find major defects, in which case you'd probably recycle the frame rather than riding it, but if you don't you haven't really learned a huge amount - there might be defects just below your ability to detect them, or of a type that you can't detect. In general this is a class of problems summarised as "you can't prove a negative".

More practically, if you carefully inspect the bike for obvious cracks, dents and other major damage, and don't find any, it's probably safe to ride. I have bought and ridden bikes like that for years, generally until so many things are worn out that it's cheaper to buy a new bike than repair everything. That is not unusual with bicycles, barring crashes the frame is often the last part to fail, and the failure is often "it wore out" rather than "it broke". Threaded parts get too worn to hold whatever screws into them (bottom brackets), friction-fit parts get loose (like headset cups), parts that wear, wear to the point of being dangerous (dropouts).