The song is "Purple Rain"—the title track of Prince's 1984 album and film. Written and produced by Prince (with engineer Susan Rogers). It features the iconic guitar riff, driving beat, and soaring vocals depicting a doomed romance.
In the film, Prince's character (The Kid) has a strained relationship with his abusive father (Francis L.), who plays piano. The Kid completes his father's unfinished composition—which becomes "Purple Rain." So the song is diegetically the father's, but actually Prince's.