I don't have a clue what happened… Got the frame this way.
Mountain bike is Lapierre Zesty 2014.
Bicycles Stack Exchange is a question and answer site for people who build and repair bicycles, people who train cycling, or commute on bicycles. It only takes a minute to sign up.Sign up to join this community
If it's an aluminium frame it's fine. The dent is relatively small on a large diameter tube so will not affect frame integrity.
I guess you just bought the frame used. If you bought it in person you should really have checked for damage before making the trade. If it was bought online and the dent was not mentioned in the ad you technically have a reason to return it the seller and get a refund. If used a site like Craiglist you'll have to negotiate with the seller, if a site like Ebay you can use their dispute resolution tools.
In any case it's fine. If and when you crash on this frame at least you won't feel so bad about putting scratches or small dents on it.
Add this area of the bike to your periodic maintenance checks, ideally monthly. If you see a change in the area then reevaluate whether its safe to ride. A change would be cracks getting longer or wider, or a sudden softness to the ride.
Given its your downtube, that's a major structural component. If it did break suddenly, you'd probably fall down between the wheels and bend the top tube with your chest. This would be a very bad thing on the flat, and even worse if riding at speed or on a technical part.
It is unlikely to fail catastrophically, but could slowly deteriorate. Any additional damage in this area could also have a larger than expected effect.
tl:dr Keep an eye on the area and look for changes.