Cavani came off the bench to score twice in Sunday's win at Southampton.
"They (United) had Rashford and Greenwood there in the first half and they may end up being centre forwards but that's exactly what they lacked is a proper number nine," said Shearer on Match of the Day 2.
"They had no width, they didn't have a focal point and that all changed when Cavani came on. It was far too easy for Southampton and we were struggling to work out what sort of system Man United were playing.
"They had no width on the right-hand side and everything was going through the middle and that was so easy for Southampton to contain and they handled it with ease.
"Look at what changes in the second half, They have a guy (Cavani) who is intelligent enough, never static. He is on the move in the box and they get crosses in there.
"He gave them some width also, when he got out there he didn't disappoint.
"But what impressed me most is the intelligence and the hunger, he attacks the space. Just look at the number of bodies he actually runs past to get on the end of the ball (for his first goal).
"Rashford and Greenwood need to keep working with him because they will learn from him.
"The Southampton defenders can't keep up with him. He made the difference, he won the game for Man United. He was absolutely fantastic."
Asked what his advice would be to Cavani's less experienced team-mates, Shearer added: "Watch him, listen to him. Learn from his professionalism.
"He has had a wonderful career, scored God knows how many goals in his career and they can only learn from him."