学而优则仕

xué ér yōu zé shì

one who is successful in one's studies, can become an official (idiom)

xué

to learn

ér

and

yōu

excellent

(literary) (conjunction used to express contrast with a previous clause) but; then

shì

to serve as an official