For this image of the Andromeda galaxy I used a modest 5" refractor:
Very nice. My mind is blown. I had no idea you could do that with a 5 inch telescope.
Now the big question; approximately how much would it cost for the setup to take this picture (telescope, electronics, hardware, etc.)
Well you don't need to spend too much money to get a decent result - say, £1k-1.5k for everything including camera, but astrophotography is an intrinsically expensive hobby and if you're a perfectionist who isn't happy with the flaws produced by anything less than top quality then you get sucked into the whirlpool. I happen to use kit capable of much more tricky objects than that simple RGB image, I use a 10-Micron GM2000HPS robotic mount, A big (sensor) cooled CCD camera (requiring correspondingly large 54mm narrow-band filters), and several different telescopes (that particular one being a Televue NPS127 fitted with autofocuser). There is also an almost endless list of accessories needed.
I will try to frighten you off
The aforementioned filters (OIII, SII, Ha in 3nM bandwidth) were close to £1k each. The mount currently runs around £12k (that's just the head, needs extra stuff to work too like counter weights etc.,), the 5" Televue scope about £8k, the Moravian CCD camera about £5k. Believe me, that's just the start of the expenses..