Answer: Jesus gave his well known salt of the earth parable (Matthew 5:13) during his Sermon on the Mount message on Mount Eremos. The message was given a short time before the Passover season of 28 A.D.
We can discover the meaning of being the salt of the earth by briefly looking at the parable that follows it. Jesus, in Matthew 5:14, calls on believers to be the light of the world. The "light" here represents their humble works of service and love they are to do as an example to others. By doing these works out in the open they advertise the goodness of God to others such that the Father is glorified in the process (verse 16).
Being the salt of the earth means making a concerted effort to make a noticeable difference in the world. Just like the condiment, when added to food, is not only noticed but also enhances its flavor, good works done by Christians make life in an otherwise carnal world more palatable.
Jesus warned that like salt losing its flavor that Christians can lose theirs. What exactly did he mean?
. . . but if the salt has become tasteless, with what shall it be salted? For it no longer has any strength, but is to be thrown out and to be trampled upon by men (Matthew 5:13, HBFV).
Houses, in the first century A.D., were often built (or had added to them) with upper rooms where guests could stay for the night or which could be used for special occasions. These rooms usually had floors composed of wood that had a special plaster mix laid over them.
Ordinary plaster used for building structures like walls was too soft for floors since it was prone to peeling and cracking. Adding salt to plaster made it hard enough to withstand the wear and tear experienced by a floor. Doing so, however, rendered the mineral impure and no longer able to fulfill its primary role as a seasoning agent. They only thing it was good for was to be trampled (walked on) by people.
Christians, as is symbolized in the salt of the earth parable, need to live a holy life full of good works that make a difference in the world. These actions will help them retain their "flavor" and continue to be useful to God. Believers, however, can lose their "saltiness" by not doing good works, or by taking the gifts they have and using them for selfish purposes, or by indulging in sin and false doctrines. Such actions will cause them to lose their purity and ultimately lead to them becoming useless and vain (see Mark 7:7 - 9).