Answer the following question, with explanation first.
Has Justin Timberlake ever written a song about Britney Spears?

yes
Justin Timberlake and Britney Spears dated in 1999.

In 2002, Justin Timberlake released a music video for his breakup song 'Cry Me A River' and featured an actress who resembled his then ex Britney Spears.

.

The answer is yes