I have some nice research in math and philosophy but I don't know if I should share some of it in question form here. Can I still get it published in a journal if I post on philosophy and math stackexchanges?
Yes, you can usually submit research you have previously published online to a journal. That's effectively a preprint. These are almost universal in maths, physics and computer science (as I understand it) and increasingly common in other disciplines (such as in medical science where preprints have been high profile during the pandemic, for better or worse). A few journals may still object to this practice but that objection is becoming less common as preprints gain in popularity.
No, in this specific case you probably shouldn't share it to the Math and Philosophy stack exchanges as those sites exist to answer questions, not discuss topics of interest to the poster.