The first thing I recommend is that you use the Yamaha MusicSoft program to move all MIDI song files, style files, and music database files from the PSR-E413's internal memory over to a computer, along with a copy of the keyboard's backup file, which I believe will be named "08PK61.BUP."
Then you can perform the "backup clear" and "flash clear" procedures described on page 56 of the Owner's Manual, which may or may not resolve the issue-- if it's an internal hardware issue, clearing the backup memory and flash memory won't help. If this doesn't resolve the problem, you can go ahead and move all the files back to the keyboard's internal memory-- although it's a good idea to keep backup copies of them on your computer, in case the keyboard's memory ever gets wiped out.
Whether or not clearing the keyboard's memory helps, I recommend downloading the Service Manual from ElektroTanya.com. Actually, the PSR-E413 Service Manual isn't available there, but the PSR-E403 and PSR-E423 Service Manuals are, and they should be very similar, so you can download both of them-- they're free:
http://elektrotanya.com/yamaha_psr-e403.pdf/download.html
http://elektrotanya.com/yamaha_psr-e423_sm.pdf/download.html
If you've never downloaded a manual from ElektroTanya.com, be sure to do the following, otherwise you might waste time clicking everywhere but where you need to:
Below the image of the manual's title page are some lines of text. Look for the line that says "
This file is downloadable free of charge: ...processing..." You'll need to wait patiently for several seconds-- perhaps as long as half a minute-- until that line changes to "
This file is downloadable free of charge: Get Manual." Click on the "Get Manual" link to download the PDF file of the manual.
Pages 26 through 28 of the Service Manual describe a "test program" that's built into the keyboard. Power on the keyboard while holding down the indicated keys-- a C# Major chord in the keyboard's second octave-- and it will start up in the test program. You can perform the various tests for the ROM, RAM, panel controls, etc., but the test you're really interested in is the "PD1 Chk"-- it's test number 31 on the PSR-E403 and test number 29 on the PSR-E423, so I don't know what test number it is on the PSR-E413. Anyway, when you run that test and use a foot controller (FC4 sustain pedal or FC5 footswitch), the keyboard should play a C3 note when the foot controller is depressed and a C4 note when the foot controller is released.
Note that you should always turn off the keyboard before either plugging in or unplugging the foot controller. Also, you should use an approved power adapter while testing the keyboard, and it's also recommended that you use the power adapter while transferring files to or from the keyboard's memory.
Anyway, if the keyboard fails the "PD1 Chk" test then it evidently has some sort of internal problem that's preventing it from sensing the foot controller, in which case you should take it to someone who can open it up, check it out, and hopefully repair it.