It's normal to feel that way. Most of the time, I feel that I don't speak up unless the teacher is right next to me or is talking to me.
Well, honestly, as a nervous person myself, I'm not sure what to say.
In the past times I spoke up in class was when I genuinely didn't care about other's opinions, cause I knew at the end of the day, nobody actually cares and they're all focusing on themselves .(did u know that everyone else is also self-conscious just like you?! Lol).
I mean even if people think you are dumb, wouldn't they think you are smart afterwards if you got good grades from constantly asking for help from the teacher.
And even if they still think you're dumb, the world won't end don't worry. I mean personally, one time in class while others were on Q13 or q5, I was stuck on q1 and the teacher said out loud(when the whole class waa silent), not intentionally, that I'm on q1. ( I found this embarrassing, but yeah I got over it super quickly)
And honestly, if you still cannot speak up in class, it's alright. Other options are available like for example you could possibly ask the teacher for help after class finishes and no-one is watching or you could self improve through maths videos online. It's also fine if you don't find this helpful. Sigh. I'm in yr12 right now.