Is this grammatical?
''You have to beg me if you really want some money.''
It sounds weird to ear, what should be the preposition for this?
Your example would be better if written this way:
You will have to beg if you really want some money.
The verb "to beg" does not require the identification of the target of begging in most instances. This is because the sentence structure will almost always imply who will be begged. In the case of your example, "you" are expected to beg the speaker.
The only time (off the top of my head) that you would need to identify the person to beg is when you must identify a third person.
You will need to beg your father if you want the money.