How do scientists know that galaxies change over time?
This is actually a very complex question! What evidence do astronomers and cosmologists have to elucidate the formation and evolution of galaxies. I can link you to a paper that might do justice in explaining the concepts, but it’s lengthy (and accurate!). I posted that link  at the bottom of this post.
So let me try my best to explain the idea simply. We all know that astronomers and cosmologists have access to one main source of information: light. Whether it’s in the form of visual light photographs of galaxies, or measurements of Cosmic Microwave Background Radiation, this is essentially how data is collected. However, data is limited down here on Earth because of our atmosphere, so we send satellites out into space to obtain information for us. The most famous of these is obviously the Hubble Space Telescope, but more recently we have the International Space Station. Astronomers use radio waves, X-rays, Gamma rays, and far-UV rays to gather information about galactic nuclei, while optical, UV and near-infrared radiation provides information on galactic stars.
Having all this information leads astronomers to make models about the universe in conjunction with cosmologists who basically do all the math. They accumulate all the evidence gathered by astronomers and try to concoct a picture that makes sense. Having done so, they’ve told us that galaxies do change over time! But how did they possibly come to that conclusion?
They look at millions of pictures. Some of our greatest evidence involves images of colliding galaxies, and the fact that galaxies of the past look different from those closer to the present: mainly, most of them were small and unstable in the far past. 
Furthermore, there are galaxies that we can observe undergoing high energy changes, and are therefore not stagnant, they are changing as we are observing them. These active galaxies fall into four categories: Seyfert galaxies, Radio galaxies, Quasars, and Blazars. There’s more information on this link: . Seyfert galaxies, for example, can be seen to change brightness every week or so, which indicates they are giving off enormous amounts of energy.