If you're looking to just get in shape, make some gains so you look good for the beach then I see no reason whatsoever to spend a lot of money on a gym membership. The only investment I'd advise would be some weights, dumbbells and a bar that you can add weights to yourself. It shouldn't set you back much and in a couple of months you'd make up what you'd have spent at a gym.
On the other hand if you're looking to become a bodybuilder or you're interested in picking up a martial art then I would indeed recommend a gym. It's got a large selection of equipment, most gyms tend to have fighting equipment (gloves, bracers, pads, punchbags) and you'll be able to find sparring partners.
Unless you're in a serious need for somebody to push you to your limit then I wouldn't bother chipping in for a personal trainer. A lot of them will just fill you with broscience and make you use all the machines that they lay their eyes on at that particular moment.
Hopefully you can take some of this advice on board and make some savings as well as achieve your fitness goals.