They are mats used by Muslims to sujud (the position in salat in which the person prostrates on the ground with his hands, knees, feet, and face touching the ground) when performing prayer.
It's often called a "sajadah" which means "a place for prostration in prayer"
To pray with, it is so you do not get dirty when performing prayer. Yes you can not offer prayer when you are dirty.You must be neat and clean before going to offer prayer or worship. http://www.teachingquran.com/Resource-Center/Download-Quran.aspx