Justin Bieber was born March 1, 1994. "Never Say Never" (featuring Jaden Smith) — the theme song for The Karate Kid (2010) — was released as a single on June 8, 2011.
At the time of release, Bieber was 17 years old (he turned 18 the following March). The track was recorded earlier in 2011, likely when he was still 16 or just turned 17.
So: 16–17 years old during recording, 17 at release.