They can mean the same indeed. It is just that 'prepare to do' is more usual while 'prepare for' is normally followed by nouns that are not gerunds: prepare to eat dinner / prepare for dinner.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.
AnonymousSo my point is whether "for - ing and to V-" in the sentences can function the same?Sometimes you get lucky and they function the same, but in the general case you should probably always choose "prepare to V" after "prepare" in preference to "prepare for V-ing".