I've been doing lots of problems and if I get stuck, I always seem to solve it and I can't find a problem that I can ask on the mathematics community to earn more reputation. Sometimes, I see questions that get closed because the original person who posted the question didn't attempt the problem properly or didn't look it up more carefully. How can I get more reputation if I also take this into consideration?
The best way to gain reputation is simply to direct your efforts towards answering questions that aren't closed / do have proper context. Off-topic questions are mostly closed and deleted, so answering them is a waste of your effort from a reputation standpoint.
You can also gain reputation by coming up with good questions of your own to contribute to the community. In fact, when I first started out on MSE, I focused on writing questions over answers.
It's okay that you don't get stuck on your textbook problems because MSE questions do not have to be problems from a textbook. The most well-received questions are those that users come up with by themselves, usually to address broader themes in the mathematics they are learning. The key is to keep the questions interesting, engaging, and well-motivated, so that the answers will benefit not only you, but the community as a whole.
I'd be much more empathetic to your question, had you asked "How can I contribute positively to this site?", and not asked only about how you can benefit by earning rep most easily.
There's nothing wrong with wanting to earn rep; but the best way to do this is by concurrently working toward the goal of contributing positively to the site. That means passing up efforts to gain rep by answering problem statement questions. You risk losing that rep when such questions are subsequently closed and deleted (and when a question is deleted, so are the answers to it).
This site works best when you aren't singularly acting to gain rep, but also constrain yourself to asking high quality questions, and answering good question to do so. In that spirit, I concur with Alexander Gruber's answer, and parts of Eevee Trainer's answer. Focus on posting good questions, and answering good questions.
Fortunately, others have done a great job giving real, holistic answers to your question. Here's my own rather opinionated take, which is more of 'a suggestion' than 'an answer'. (But it's far too long for a comment >.<)
Answer questions on page 600 of the Unanswered tab.
For the unaware: the Unanswered tab is a complete, unabridged list of questions which have not been closed or deleted and whose answers, if any, have not been upvoted or chosen as Best Answer. What are the benefits of doing that?
- Basically zero competition: Most casual users only ever look at the "Questions" tab, which strongly prioritizes newly-asked questions (or newly-updated ones; see  below). So these older questions are actually pretty hard to find unless you specifically seek them out. And besides, there's thousands of pages to look through— plenty of room for people to spread out.
- The Questioners need it: Since people don't stumble across them very often, the questions are unlikely to be answered by anyone else. But since MSE (strongly) discourages asking the same question twice, the Questioners aren't supposed to ask again.
- The site needs it: MSE is supposed to be (among other things, perhaps) a repository of mathematical knowledge. But for a repository, we're not doing great: more than 1 in 5 of our 1,000,000 questions are sitting in the Unanswered tab. Some of them are there because they're hard, some because they're technical. But a lot of them just fell through the cracks.
- Less likely to get closed: Since they've already gone through a round of people looking at them on the front page, most of the really bad questions have already been sifted out.
- Avoids a possible ethical dilemma: People like to argue on meta about whether it's "ethical" or "within the scope of the site" to answer homework-like questions. (I'm not interested in arguing, please don't @ me.) If this doesn't concern you, okay. But if it does, then all you have to do is go a few weeks back. That frees you up to just do the math; you don't have to worry about accidentally helping someone cheat. (If it really was homework, it was certainly already due!)
A couple footnotes:
You might think that, because the questions aren't seen much, that your answers won't get seen either. That's not true because posting an Answer counts as a major enough activity that it gets a big bump, and will probably end up on the front page for a little while.
I suggested parenthetically above that you should answer questions on page 600. That's obviously not a specific number, but there's a point: if you work in the single digits, you're not really gaining these advantages. But if you go back too far, the easier questions have all been picked through. At the current rate of things, pages 400-500 contain the questions asked roughly one month ago.
For reputation grinding, you will need to be somewhat selective about the questions you answer. In particular, lots of people come to MSE, ask one question, and then when it hasn't been answered for a day or two, leave and don't come back. Therefore, you might want to click through to the Questioner's profile, to see when they were last active. If someone answers your question, you get an inbox notification, no matter how old it is. So as long as the Questioner checks their inbox, they'll see your work :)
If someone has essentially answered the question in the comments, I personally prefer to @ them and let them know that they might want to write an answer, rather than trying to get rep for their ideas. (But I can see the opposite viewpoint: you're not supposed to post answers as comments, after all.)
I agree with other people who are a little bit concerned with the emphasis on earning rep, as opposed to helping the site prosper so that it can help you when you need it. But I find that for the purposes of answering Unanswered tab questions, these goals often go hand in hand.
To elaborate a bit on Alexander Gruber's answer on a matter of experience, I've done a fair bit of everything around the site (that someone with my rep can do):
- I have asked (somewhat okay) homework questions
- I have asked questions based on problems I've thought up or such related matters (i.e. not related to coursework)
- I have answered a number of questions in various ways and the questions themselves in various states
- I have done various editing and review tasks as well, though those don't yield rep (they yield valuable insight); editing does yield rep if your posts get accepted but only up to when you have $2,000$ total
In that light, I can offer some explicit tips on gaining rep "quickly:"
Ask interesting questions. Questions people will want to click on. Interesting questions, that carry concepts people might want to know about, or just something that one could be curious about. Questions that basically come out of a problem in a textbook aren't going to be very interesting. Oh, yes, people will answer you, help you understand, even give you votes, no doubt. But questions I came up with independent of coursework got better responses, rep-wise. Even if it's just some passing wonder or fancy of yours, or a lurking thought that's been in the back of your mind for weeks but is a tough nut to crack - sometimes these are the most interesting or insightful questions.
Attempt to answer your own question, where applicable. MSE users value a clear intent to learn and apply their own guidance. If some users give you hints and nudges on solving a problem, taking the plunge and fleshing that out into a proper solution will be well-received. People will be happy that you learned, and that they helped you do so. It's right in line with the goal of the site. (Footnote: this does not mean that you should ask trivial questions, or deliberately incomplete questions, with the intent of answering them yourself.) I actually got a bounty once just for doing this, which was rather sweet of the guy who gave it to me, considering it was just fleshing out his and others' comments.
Don't be afraid to ask. Don't get me wrong, sometimes you will get downvoted or closed, if your question is poorly framed or something of the sort. But some of the questions I thought dumb or unimportant, actually got the best reception. That's not to say "ask immediately after a question comes to mind." Do some research, make your own attempts at cracking the nut that is your question. If you don't make progress, asking for help is fine; no one expects you to know everything. In fact, include these attempts and such in your question, and formulate your question well. That will show MSE that you care about the problem, and about the solution, and where said solution comes from.
Which also means: be open to questions. Be open to questions; that is to say, be willing to harbor whatever questions come to mind, mull them over, tackle them. Seeking out unanswered questions in mathematics might be a bit much if you're inexperienced, but if a problem comes to mind, don't necessarily toss it to the wayside. Tackle it, to the best of your knowledge. To ask good questions, you have to ask questions in the first place.
Other tenets, such as being clear, giving context, and so on, as go for asking questions in general, also apply. But the above help turn a "good" question into an "awesome" question.
You can answer questions which already have answers. However, be sure to add something to the discussion. (Otherwise, who cares?) Every now and then I find a question to which I can offer an alternative approach; I in particular like offering intuitive approaches where applicable. Approaching a problem with a different angle can also be valuable and give further insight for the OP and for future readers. This won't guarantee a ton of votes necessarily, but if nothing else you are helping, right?
Keep an eye on the newest questions feed. This is mostly what I do, considering I'm basically on the computer all day. If you're like me and your understanding of various fields is relatively rudimentary if not weak, you can be kinda left fighting for scraps when it comes to rep. In that sense, getting rep via answers honestly will require a trigger finger, metaphorically speaking. (Just be sure to double-check your solution and be confident in your answer. Do not be quick for the sake of being quick: that lends itself to errors. Even if others post other answers while you write up your own, take the time to ensure yours is the best!)
Ensure your answer is the best. This bears restating. Good answers yield higher amounts of rep. What makes an answer good? Well, it depends on the question, but generally...
- If at all avoidable, do not give a full solution to a problem, or at least homework-type problems. "Teach a man to fish, etc." If the problem is "solve this (simple) integral," for example, illustrate the process. Maybe solve a similar problem to illustrate said process. This won't always be possible for a good chunk of problems asked on MSE, but it's a nice idea to keep in mind. Working out fully a homework-type question is just begging for it to be copied-and-pasted into someone's homework.
- An intuitive answer can be really useful to the OP if explained well. Of course this may not always be possible depending on the constraints of the problem. (Can you tell I love intuition yet?)
- Explanation is better than brevity. It irritates me to no end when I see people post equations and numbers and whatever, without the slightest explanation where they come from. Your goal is to help and teach both the OP and everyone else who finds themselves stuck there in the future. Clarity and explanation is worth it, in that sense.
Don't bother with PSQs too much. These are those posts where someone just literally posts the problem. No explanation or context or whatever. Not even an "I don't have a damn clue on what to do here." At best you could give a nudge, but even that is questionable and might encourage more people to do so on the site, which might not be a good thing. These questions ultimately end up just closed and ignored. If you can edit the question somehow or get them to edit it - a narrative with the OP, establishing how to better their question, explain their understanding and tips, or whatever - then it might be salvageable. But otherwise, better to just flag the question, downvote, and move on without wasting your time. Particularly where rep is concerned. (Footnote: as a recent meta question noted, if you find such a PSQ interesting and can flesh it out with your own context and understanding, but get stuck yourself, it might be worth asking it as a separate question.)
Use the review queues. After gaining oh-so-much rep, you'll gain access to various review queues, which concerns itself with low-quality posts, first posts, questions that are flagging for closing, and so on. Depending on the context, you will find questions or answers you can improve on, discussions to add to, and so on, that you might not have expected. Several times I've run into stuff in the queue that I can help out with, questions I somehow didn't see posted (everyone has to sleep, right?) for example that don't have an answer, a satisfactory answer, or, at worst, at least I can add something to the discussion of.
There are probably more tips than the above for gaining rep "quickly;" this is mostly just a reflection on my experiences with the site thus far.
Though, rep doesn't really come quickly, to be truthful, but you can at least make it more efficient, while simultaneously focusing on making MSE better.
I've been a top 5% contributor for the last two years and I have not asked a question yet so it seems answering questions can be a good way to build reputation. If I had to say what I am doing correctly it would be that I check the unanswered questions regularly and answer every question I can. I get a few points for accepted answers and every now and then the bandwagon effect brings in a large reputation boost.
Stylistically I like to provide links to Wikipedia or other relevant resources and use natural language as much as possible. Sometimes it's the niceties that get you the extra vote or green checkmark when there are competing answers. Two of my highest reputation answers are one sentence with no symbols or numbers that have a link in them and another two are merely explaining notation so even relatively simple questions can be useful for building reputation with answers.