Can a goldfish be kept in sealed jar?

No, a goldfish should not be kept in a sealed jar.

A sealed jar will not provide enough oxygen for the goldfish to survive. There will be no air circulation and the goldfish will eventually suffocate. Additionally, the build up of waste products such as ammonia and carbon dioxide will poison the water and further harm the goldfish.

Goldfish need a properly filtered tank with a properly oxygenated water supply in order to survive.