What does this student know about composition of functions?

What’s going through the kid’s brain when he makes his mistake?

How would you help?