Hey Anna! Great question. Let me add something to the great comments of others.
"I wonder if it will rain." = I'm in doubt about this; will it rain? I don't know. We don't know. Maybe you know, but I'm just thinking out loud, I'm not asking you. This isn't a question, it's a statement.
However, if we're talking about the actions of others, particularly the person we are speaking to, we might use "wonder" as an indirect way of asking a question, like this:
"Hey Jack, I wonder if you would help me paint my apartment on Sunday. I'll give you some pizza."
This is quite casual, but common enough, and polite. Notice that the person is saying they're just thinking about it: they're curious about it.
Anna, you were wondering about "wonder" and "ask." I hope our explanations have helped! We're all probably wondering if we helped or not—could you let us know?