No. You do not have to shell out dollars to belong to a gym in order to keep fit. A run along the canal or round the block plus walking or cycling to work and attending an exercise class of any kind will do the job of keeping you fit. The main thing is not to let a day go past where you have loafed on the sofa and done nothing.
Take some form of exercise every day. You can swim, dance, run or cycle and keep fit that way. Some people go to the gym, but that's only one option. And by the way, being outdoors is much better for your health than being indoors.