Found in the attic?

House was 60 years old, 800 sq ft in size and very plain designed gable roof. New shingles and sheathing.
Why the copper pipe in the attic? LOL

My guess: a plumbing vent. Looks like it once had a connection that went through the roof. When it was re-roofed, they disconnected it.

Correct