It may be possible to prevent her from being deported if you marry her, but more information is needed about her immigration history and the reason she was arrested by Phoenix PD. You will not get in trouble for allowing her to live with you. Advise your girlfriend not to sign anything presented to her by ICE - they will give her the opportunity to leave on her own (voluntary departure) and if she signs and agrees to this she will forfeit the right to see an immigration judge.
I would recommend consulting with an immigration attorney on your girlfriend's behalf to ensure that her rights are protected if she is placed in removal proceedings.
Answers on Avvo are general in nature and do not constitute legal advice; specific answers require knowledge of all the facts. You should consult with an attorney to review all the facts specific to your case in order to receive advice upon which you can reasonably rely.
You will not get in trouble if your only offense is having an illegal immigrant as a girlfriend. AS to your second question, the best thing you can do is to look for an immigration attorney ASAP. That may mean a difference between US and Peru.