Sushi was originally invented for preservation. rice would be fermented for up to a year in order to store fish - this was known as narezushi, the rice would usually be thrown away and only the fish would be eaten. Narezushi showed up in Japan in the 8th century. Different parts of Japan developed their own meaning of narezushi. In those days, it was only eaten during feasts and festivals. Narezushi was made up of rice and fish pickled together, mixed with rice vinegar and sake, then it was left under a rock to ferment.
Info from: https://www.eat-japan.com/sushi-perfect/