Check the journal/publisher policies, but you will almost certainly find that these draw a distinction between the published version and the author accepted manuscript. The author accepted manuscript is the final version you gave them. The published version is the one they subsequently gave you, which will have some changes of questionable value including their own formatting.
What people normally do in pure math is to put the author accepted manuscript on arXiv. This is almost always permitted (all the big commercial publishers allow it). ArXiv probably won't even accept the published version, not for copyright reasons but because they require the source files which you won't normally have access to.
Unless you are publishing open access, you usually can't upload the published version anywhere publicly accessible. You also normally can't put the author accepted manuscript on ResearchGate, since the permission to put it on arXiv is usually specific to a small number of sites. E.g Elsevier's policy says
Authors can share their accepted manuscript [...] By updating a preprint in arXiv or RePEc with the accepted manuscript (and updating the license to a CC BY-NC-ND license) [...]