Chosen Solution

I bought this mac for 50 bucks thinking it would be an easy fix. I bought a new flex cable and installed it since the keyboard and trackpad did not work. When I replaced it the battery now died and I can only use the mac while charging. the battery is damaged and does need to be replaced but will it fix the trackpad and keyboard

Do the keyboard and trackpad work with the new trackpad flex cable installed (you can test this by powering on the machine with a charger connected and the battery disconnected)? If so, then it sounds like you no longer have a keyboard / trackpad issue, just a battery issue. You can check the condition of the battery using an application like coconutBattery or the internal diagnostic test by holding down “D“ on startup. To answer your question, the battery is independent of the trackpad and keyboard. Replacing it should not effect the functionality of either, unless you damage the trackpad cable or other components in the process.