1. I studied math for 10 years, but I'm still not good at it.

2. I have studied math for 10 years, but I'm still not good at it.
-----------------
Which one is grammatical?

1 means you used to study it, but don't study it anymore, and are not good at it.

2 means that you studied math in the past and are still studying it, but still are not good at it.