Can I have a PhD in one field, and be an avid academic contributor in another? Disclaimer: I'm an undergrad with very limited knowledge of how academia really works and what the atmosphere and culture is like.

I'm very interested in pure mathematics, and I think I'm pretty good at it. I'm currently an undergraduate in my university's Pure Math program. However, I'm also incredibly interested in mechanical engineering and entrepreneurship, and want the skills to be able to build things, to be involved in and lead engineering projects and design systems and products that will one day (hopefully) make the world a better place.

So I was thinking, maybe I should finish my pure math degree, then enter mechanical engineering and possibly work towards a PhD in that field. However, I would still love to be an avid contributor and active member of the pure mathematics research community.

In a hypothetical situation where I get a PhD in mechanical engineering, what would be the best way to get involved in the pure math academic community, to the extent of:


writing and publishing papers
contributing to the works of other established pure math researchers
potentially being a part of research groups or committees
etc.


Basically, I want to have a PhD in one field, and somehow be able to participate in the lifestyle of a PhD in another field sometime later in life. How might I accomplish this? Is there a generally accepted path academics take to achieve this, or is it frowned upon by academics to attempt to be an active member of two, divergent academic fields?

Edit: I wanted to clarify that I wouldn't get the PhD in mechanical engineering, only to then be an active member in a different academic community. Ideally, I would participate for a large portion of my life in mechanical engineering, and another large portion of my life in pure math.

I also wanted to point out that I recognize that getting two PhDs isn't a valid option, nor is it one I necessarily want to pursue. I also don't want to do a bachelor's degree and a PhD at the same time.

Finally, I would like to add that I am not in any form attempting to prognosticate my life; maybe in two years I won't be interested in mechanical engineering and entrepreneurship anymore. I'm just curious about the nuances of such a path.
In principle there's no problem with that. Many researchers change their fields over the course of their career -- sometimes slightly, sometimes drastically. No one cares what your PhD says on it, just the quality of your work. 

There are a couple of caveats. If you need funding for the new field, you may have trouble convincing funding agencies that you're competent to perform the work.  And of course it can be hard enough to do good work even when you devote all your time to one field, let alone two (though on the flip side, using insights from Field A may give you a new view on Field B). 

But the field your PhD is in, by itself, doesn't limit your activities.