Was who a ghost?
He was his own warning.
The story about the mother tapping on the window was the signpost.
It was a form of premonition that served as a warning to what would happen. The 'ghostly' tapping on the window she witnessed whilst cleaning was a premonition for the real tapping that occurred when she was in hospital.
Likewise, the series of events that led to the ending were all shown as 'ghostly' moments leading up to the ending - just in more detail and for a longer period.
He understood it was a warning at the last minute when he worked out that he himself was the 'ghost'. There was no actual ghost.