If I had $5,000 to invest in ASX shares, I would want to own businesses that will still be important in 10 years.
That is why I like ResMed Inc. (ASX: RMD) and TechnologyOne Ltd (ASX: TNE).
They operate in different markets, but both solve problems that are not likely to fade. One is helping people manage sleep and breathing disorders. The other helps important organisations run essential systems more efficiently.
I think that gives both companies a strong starting point for long-term investors.

Image source: Getty Images
ResMed shares
ResMed is an ASX healthcare share I would happily buy with part of that $5,000.
The company is best known for sleep apnoea devices, masks, accessories, software, and connected health technology.
This is a great place to be. Sleep and breathing disorders remain a large, underpenetrated healthcare market. Many people are still undiagnosed or undertreated, which gives ResMed a long runway if awareness and access continue improving.
Its recent numbers also show that demand has not disappeared. In the third quarter of FY26, ResMed reported revenue growth of 11% to US$1.4 billion. It also delivered 18% growth in non-GAAP income from operations.
I would not buy ResMed just because one quarter looked solid. I would buy it because those numbers support the broader point: the company is still growing while investing in a market with significant long-term need.
There are risks, including competition, GLP-1 drugs, and healthcare sentiment. But I think the market may be underestimating the durability and size of the opportunity.
TechnologyOne shares
TechnologyOne is another ASX share I would buy for the long term.
The company provides enterprise software to customers such as councils, government departments, universities, and large organisations. These customers need dependable systems for finance, payroll, property, student management, compliance, and reporting.
That type of software may not sound exciting, but I think it can be extremely valuable.
Once these systems are embedded, replacing them can be disruptive. That gives TechnologyOne a strong customer relationship if it keeps delivering.
The shift to software-as-a-service has also strengthened the business model and supported strong annual recurring revenue growth. In the first half of FY26, TechnologyOne reported annual recurring revenue of $598 million, up 17%. SaaS and recurring revenue increased 13% to $299.2 million.
I also like the ambition. Management says the company is on track to surpass $1 billion in annual recurring revenue by FY30 and continues to talk about doubling the business every five years.
That is not guaranteed, but I like businesses that have clear targets, recurring revenue, and multiple ways to grow.
TechnologyOne is also investing heavily in artificial intelligence and its SaaS+ model. If those tools help customers simplify complex operations, the company could become even harder to replace.
Foolish takeaway
I think ResMed and TechnologyOne are two ASX shares worth buying with $5,000.
What I like most is that both companies are building around real customer needs. ResMed is helping address a large healthcare problem that remains underpenetrated, while TechnologyOne is becoming more deeply embedded in organisations that need reliable software to function properly.
Neither share is risk-free. But I think both businesses have enough growth, relevance, and ambition to reward patient investors over time.