Macbook suddenly refusing password
I haven’t come across this, but it may be worth trying to create an additional Admin account and logging into that to reset your password on your current account.
How to create an additional Admin account
You can do this by tricking your Mac into thinking it's being set up as new:
- Boot into Single User Mode by restarting your Mac and pressing and holding ⌘ + S as soon as you hear the startup chime
- Keep these keys down until you see a black screen with white text
- Mount your drive by typing in
/sbin/mount -uw /
and then pressing the enter key - Remove the Apple Setup Done file by typing in
rm /var/db/.AppleSetupDone
and then pressing the enter key - Now reboot your Mac by typing in
reboot
and then pressing the enter key - Follow the prompts to complete the setup process and create a new admin account
Once you've done the above, try starting up and logging in as the new admin user. Assuming you can, then see if you can edit the password in your old account (just try changing it to your existing password).
[UPDATE]
Since we've established that even trying to boot into Single User Mode isn't working for you and that trying to do so results in the normal login screen appearing, I think we'd better investigate the possibility that your keyboard is faulty. This would explain your password not being accepted and the fact that pressing keys during startup may not have the desired result.
The best way to test this is to connect a USB keyboard and try using that. If you haven't got one, any cheap USB keyboard will do.