The Caveman's Valentine
(2001)

Romulus Ledbetter (Samuel L. Jackson) is a schizophrenic man living in a cave in a park in NYC.

One morning, he awakes to finds another young homeless man, Scotty, dead in a tree outside his cave. Ledbetter assumes the dead man was put in the tree by his "enemy who lives in the Chrysler Building", and tells the police (including his daughter) that he killed her. A more likely suspect is quickly established by the dead boy's alleged lover. He thinks the guilty party is David Lepperaub, a gay masochistic photographer who abused the Scotty, who was his model. Romulus investigates by posing as a pianist (He was an accomplished pianist at Julliard before he went crazy). He meets the photographer's assistant Joey, who leads him to a tape of Scotty being tortured.

It turns out that the person torturing Scotty on tape, and the person who killed Scotty by freezing him to death, was Joey. He was jealous of Scotty, and how Leppenraub preferred Scotty over him, so he froze him to death in the freezer, and set him up in the tree outside Romulus' cave. Joey had been going around the village pretending to be Scotty after the murder, saw Romulus, and decided he would frame Leppenraub using Romulus. Romulus and his daughter set up a police sting on the subway, catch Joey in a lie, and arrest him. Romulus' daughter offers to let him come back and lvie in the house, but he decides to stay in the park.

Thanks Paul B!