In the beginning, there were several times when Kousei was playing the piano, and he suddenly felt that he was at the bottom of the ocean and couldn't hear what he was playing. Why did that happen, and was he able to hear himself play at the end?
The reason is because of the psychological trauma he suffered from being forced by his mother to play exactly as the notes book dictates and punish him for every wrong notes. He felt frustated as even when he did his best and won competition by competition, her mother still wasn't satisfied as he still made a few mistakes here and there, despite already called as the human metronome for his astounding accuracy by others. And the when he's fed up, he burst in anger at his mom and soon after his mom died, making him feel shocked and guilty which shown in his mother's ghastly appearance in when he played his piano. This psychological trauma is the cause and it doesn't immediately kick in too, which explains why he can hear the first few notes and when he's getting into it, he lost it.
The more he focuses, the more he gets into it, and the more the traumatic memories kick in. It's probably some sort of side affect from maybe PTSD or Post-Traumatic Stress Disorder that only occurs in Kousei's case, because his mother introduced him to the piano and now since she is gone, part of the piano left with her.