The whipping boy - Fleischman, Sid (Greenwillow, 1986)
A bratty prince and his whipping boy have many adventures when they inadvertently trade places after becoming involved with dangerous outlaws.