How do people who are not active in the academic community write papers? Is it possible?
It is possible.  After years away from graduate school, I am working on several papers, covering both old and new topics.  However, it is very hard to do it completely alone.

I have the benefit of some contacts acquired through one of the forums on StackExchange.  They are willing to spend a limited amount of time (say half an hour a month, to within two orders of magnitude) in email correspondence with me, to receive drafts from me (but not necessarily referee: just skim for a few minutes and find more egregious aspects which they kindly point out), and most importantly, endorse me for posting on ArXiv.  Before the endorsement, I spent some time convincing them I wouldn't be a drain, that I could help them out, and that I might hope for a favor regarding endorsement, literature search, and so on.  Realize that from their perspective, I could be a potential crank or downside on their career, as I have given them almost no verifiable information on what little credentials I have.  I consider their involvement as a gift, and treat it with care.

With their minimum involvement, I now can post results on the ArXiv, and use that as a stepping stone to loftier research goals.  Since your express purpose is to produce research for others to read, you need three things: the research, the others, and a means to get the research to the others.  Getting to know one or two of the "others" is key.  Getting them by being helpful on this and other fora is one of the easiest routes I know for this step, but there are other methods.  There may be other repositories besides the ArXiv which may help you more, but I don't know of them; ask the "others" for advice, and respect their time.  The research part, that's your problem, again with which "others" might be able to help.