Jesus is asking WHY is He being called good? Absolute Goodness belongs only with God. He is not denying that He is Good, or God; but showing that only God is truly Good.
Jesus forgave sins, which is only possible if He is Almighty God. (see, Matthew 9:1-8; Luke 7:48, etc)
Jesus accepted worship, again, only possible if He is Almighty God. He told the devil who was testing Him, "worship God", and yet there are many times recorded in the Gospels, where He was worshiped as God, and never once did He say, "don't do this, as I am only a human being". (Matthew 2:11, 14:44, 28:8-9, etc)
Jesus said in John 5:17, "But Jesus answered them, My Father worketh hitherto, and I work.", in a unique sense, as His own Father. This is how the Jews also understood His words, "Therefore the Jews sought the more to kill him, because he not only had broken the sabbath, but said also that God was His own (so the Greek) Father, making himself equal with God.". This was seen by the Jews, as Jesus "making himself EQUAL with God". We have a very interesting definition of the Greek word, "ἴσος" (equal), by Dr Joseph Thayer in his Greek lexicon, "to claim for one's self, the nature, rank, authority, which belongs to God". Thayer was a Unitarian, who denied the Deity of Jesus Christ! But here is honest in giving what the words actually means, rather than twist its meaning to suit his beliefs. NO human being can ever claim EQUALITY with Almighty God. Note that Jesus never "corrected" the Jews by what they said.
Jesus also claimed EQUAL "power, authority and protection", with the Father. "My sheep hear my voice, and I know them, and they follow me. I give them eternal life, and they will never perish, and no one will snatch them out of my hand. My Father, who has given them to me, is greater than all, and no one is able to snatch them out of the Father’s hand. I and the Father are one.” (John 10:27-30). Believers are secure in the Power of Jesus, as well as the Father, Who are BOTH One, essentially. This is impossible for Jesus to have said, IF He were not Himself 100% COEQUAL with the Father. His words would be blasphemy, IF they were untrue.
Jesus also climed EQUAL HONOR with God the Father, "that all may honor the Son, JUST AS they honor the Father. Whoever does not honor the Son does not honor the Father who sent him" (John 5:23). In the Greek, "just as" is, "exactly in the same manner". ONLY One Who Himself is Almighty God, could make such a demand!