If you want to know who wrote a particular Beatles song, a big clue is the lead singer. When you hear John Lennon on the vocal of an original track (e.g., “Strawberry Fields Forever” or “Come Together”) it’s a safe bet he was the composer.
The same goes for songs featuring Paul McCartney (“Martha My Dear“) or George Harrison (“Savoy Truffle“) on lead vocals. But there were exceptions during the Beatles’ epic run. Early on, John passed “Do You Want to Know a Secret” to George for him to sing. (He thought it suited George’s range.)
Later, for Sgt. Pepper’s, John and Paul collaborated on “With a Little Help From My Friends” with the understanding Ringo would sing it. John’s “Good Night” (also for Ringo) on The White Album falls into this category as well.
However, you weren’t going to see John writing a song for Paul to sing (or vice versa). They just didn’t work like that. Looking back, John pointed to one Abbey Road song he thought he could have taken off Paul’s hands — and done a better job on vocals, too.