Problem: Numbers 13:16 says that Moses called Hoshea the son of Nun, Joshua. But, as early as Exodus 17:9 Joshua is referred to by that name. How can this passage say that Moses was the one to give Hoshea the name Joshua?
Solution: First, it must be remembered that Moses probably wrote this toward the end of the 40 years of wandering in the wilderness. Although Joshua may not have been given this name until the time referred to in Numbers 13:16, it would have been natural for Moses to refer to Hoshea as Joshua while composing the final drafts of the books of the Pentateuch. Also, the point at which Moses notes the fact that he referred to Hoshea as Joshua is quite appropriate. In recording the names of the spies whom he sent into the land, Moses endeavored to make it clear that Hoshea was the very same person to whom he had frequently made reference in other parts of the Pentateuch by the name Joshua.
Second, it is not necessarily the case that Hoshea was not called Joshua until this point in the process of the historical events. Perhaps it was simply the case that Hoshea was commonly known as Hoshea, but that Moses had called him Joshua from the beginning. The text does not say that Moses began to call Hoshea, Joshua at this point in time. The text simply states that Moses called Hoshea by the name Joshua. It may be significant to realize that the name Hoshea means “salvation,” while the name Joshua means “Yahweh is salvation.”