You will need to replace a section of the carpet. Using a sharp razor blade cut a square out of the carpet where the tear is located. Cut a square out of the new carpet that is the same size. Using carpet tape from your local home improvement store install the new section of carpet.
If it is torn through to the padding beneath, you can repair this by using liquid nails project glue. Place it between the carpet and mat and press down.