The rich young ruler has approached a 'teacher' on earth and called him 'good'. And has asked advice from this (supposed) 'teacher' (who is supposedly 'good') how he might inherit eternal life.
Jesus is aware of the man. Clearly, for later he touches a nerve and puts his finger on the one thing that the young man did not want to relinquish.
To the ruler, Jesus faces what the man is not facing : the fact of law and the fact of broken law and the fact of sin.
'Teacher' is not 'Saviour'.
The man wants to be 'taught' how to inherit eternal life. he has not yet learned the lesson of the law, that there is none good, no not one. None can rise to the absolute requirements of law. None, that is, who is flesh and blood and born of Adam.
None that is born of the man of sin and death, which humanity has - already - chosen the way of works, the way of knowledge, the way of self-reliance and self- righteousness.
So, Jesus starts at the beginning : the commandments.
And the man thinks he has kept them all.
So Jesus homes in on the covetousness of the man's inner spirit.
And discovers the real state of the man's heart.
Jesus does not reveal his own personal state. Jesus does not comment on whether, or not, he is 'good' (or, indeed, whether or not he is 'God').
Jesus is answering the man's question.
And, in so doing, Jesus fully discovers the man's existing spiritual condition.
Other scriptures tell us more about Jesus himself.
This one reveals only the state of the heart of the rich young ruler.
Why do you call me 'good' ? does not tell us whether or not Jesus thinks of himself as 'good'.
'There is none good but God' does tell us that Jesus' definition of 'good' is not that generally accepted by humanity who, mostly, think one can be 'good' by keeping law.
But Jesus' words indicate that real goodness goes much deeper. Giving up all and following Jesus is the 'goodness' that Jesus indicates will be that which inherits eternal life : a 'goodness' that is impossible to man in the flesh, working at keeping law to perfect himself.
Jesus' words go very deep.
'Never man spake like this man' said some, of Him.
Indicating, by the way, that although 'come of woman' he is not of man . . .
. . . . but, of God.