He was a former Pinkerton's detective and a former cop hired by Cal's father to take care of him.
Lovejoy was also the only one that suspected that Jack had not saved Rose DeWitt Bukater from falling upon Lovejoy and Jack's first meeting, noting that he already had untied his shoes and removed his coat.
He is seen later running after Jack and Rose as they ran to the engine room. While descending within the elevator, Rose flips him. This was likely the moment where he started hating them.
Lovejoy asked the Titanic's Master-at-arms to take Jack into custody in their office E Deck. The Master-at-arms was quickly called away by a Crewman because a large mob at the Second Class purser was asking for their jewelry. Jack and Lovejoy were now alone in the Master-At-Arms office. There, knowing that the ship was sinking, and seeing that the E Deck had been evacuated, he left Jack trapped there, although Rose later saved him.
For the most part Lovejoy is seen looking for Jack and Rose, especially after Cal put his coat (with the Heart of the Ocean in its pocket) on Rose. Cal took Lovejoy's gun and started shooting at them, until his bullets were wasted. Cal gave it back to Lovejoy saying that the diamond would be his.
In a deleted scene, Lovejoy then loads the gun and goes hunting for them in the dining room. He was looking for them in the dining room but Jack caught him off guard and crushed a glass window with his head and punched him as they ran away. This was not seen in the edited version, leaving the reason his head is bleeding later unexplained. He is last seen at the point where the Titanic is breaking in half, and falling through the yawning opening.
He is not seen at the end, among the people seen by Rose among the Titanic victims. This is likely because he was one of the two major villains.
Behind the scenes
In the theatrical version, the scene where he is looking for them in the dining room and then his head is broken is not shown (considered too violent). As a result, his last appearance with a bleeding head when the ship breaks in two is unexplained.