Echoing a number of the sentiments above:
Before buying, I definitely recommend sitting down and doing a budget. Personally, I would do two.
The first form is all of the costs of a horse (as you would pay, individually, without any outside “breaks”, “help” or “cuts” in rates owed). This is things like board (feed), farrier, vet. This will also factor in things like training and lessons. Of course there’s no real way to plan for emergencies, but your budget should indicate a rate of savings for an “emergency disaster” account (if your horse gets injured or requires expensive diagnostics).
Likewise, this will also have to account the “extras” you have to spend money on. Blankets, tack, supplies, gas for increased driving amounts (and account for increased wear & tear on your car).
Break it down to monthly costs (board every month, coggins annually, farrier every 1.5-2 months, etc. You get the idea). Look at this against your standard monthly salary and other expenses. Make sure that you can afford it.
After you know how much it would cost on your own, look at how much money you stand to save with some of the “offers” you may take advantage of. (Leasor, letting your trainer use him, etc.) The issue with these things are twofold: people can always back out and change their minds, even with contracts. There’s really no guarantee you are never going to be left in the lurch with 100% of his bills to cover on your own. And the second issue is that there is no promising that as you learn more about a new horse that you will not realize you disagree with certain training methods (for him, or in general), or certain types of riding with him (or in general), and decide that you don’t want to make him available for outside individuals to use. For this reason, make sure you can afford him on your own.
Additionally, some of the comments about the plans “other people” have made for this horse once you possibly buy him make me uncomfortable. It sounds like some people may stand to get a first-rate deal at your expense which is definitely shady. Before agreeing to any deals, research the going rates in your area for the services that your horse is being used for to make sure you get a fair rate if you end up comfortable with the idea.
All the financial logistics aside: if you like him, I would proceed to a pre-purchase exam. Depending on his age and use, you will almost inevitably find “something”, but it’s up to you and your vet to discuss level of risk and acceptability. (For example, modest arthritic changes in the hocks are pretty common in a lot of horses in their teens - for me, not a dealbreaker.) But I really do recommend taking some xrays (your vet may have suggestions for what to look at, and I know many people have experiences with PPE xrays so can be easily researched), flexion test, etc. Go from there, if you like what you find.