Arduino Mega2560 + Ion Lithium Battery

"So, I have a doubt, how can I do to charge the battery through the arduino??

I'd like to use it autonomously."

Generally, get a battery charge control chip. These are available as shield from several sources.