This is a tricky business, mixing up pronunciation, dialects, and spelling.
First, the facts. English has a phonemic (i.e, distinct) sound /ŋ/ (a lower-case n with a hook tail like ɡ). You hear it at the end of sing, song, hang, rang, rung, for instance. That's not an /n/. And it's not a /ɡ/, either. It's a nasal consonant (like /m/ and /n/) pronounced in the same place as /ɡ/ and /k/. That makes /ŋ/ a 'velar nasal', because /ɡ/ and /k/ are velar stops. They're all pronounced with the tongue moving in the velar (soft palate) region of the mouth.
Old English didn't have that sound phonemically. It was automatic when /n/ preceded /ɡ/ or /k/ and never happened anywhere else. But then the velar stops started disappearing, and eventually Modern English had /ŋ/.
Second, the spelling. English spells final /ŋ/ as NG. That's cool, because (like final labial /mb/ in thumb and lamb), final velar /ŋɡ/ in sing and going lost the stop at the end of the cluster, leaving only the nasal. I.e, original final /mb/ changed to final /m/, and original final /ŋɡ/ changed to final /ŋ/. (Final dental clusters in /nd/ didn't change, though, and we have lots of words like hand and pretend that keep the final /d/.)
Third, the conflation. While /ŋ/ is spelled NG, so is /ŋɡ/, because of the change in pronunciation and the lack of change in spelling. Consider
- singer /'sɪŋər/ vs finger /'fɪŋɡər/ - Look like they rhyme but they don't.
- longer /'lɔŋər/ 'one who longs' vs longer /'lɔŋɡər/ 'more long' - Spelled identically.
This contrast between /ŋ/ and /ŋɡ/ happens in other languages, too. In Malay (Indonesian), which has a reasonable orthography, /ŋ/ is spelled NG, while /ŋg/ is spelled NGG. Thus the word that means what English speakers call a mango /'mæŋɡo/ is spelled mangga in Malay, with two ɡ's.
Fourth, the dialect mix. The active participle ending -ing /-ɪŋ/ is widely used in the Progressive construction (He is reading a book), and as is often the case with common, predictable endings and little words, it gets reduced in rapid speech to just /-ɪn/, with a dental /n/ instead of a velar /ŋ/. This is a distinction that has come to have some social attribution; the British aristocracy at the end of the 19th and beginning of the 20th centuries affected "G-dropping" as part of the cultural baggage of the upper-class "huntin' shootin' Englishman" image. Dorothy Sayers makes masterful use of this in her Lord Peter Wimsey novels.
In the US, on the other hand, "G-dropping" is stigmatized, and children are corrected if they do it. Not that everybody notices; it's a normal kind of neutralization that happens all the time and feels natural, so we do it and don't notice. But then it comes to writing and the problems all come back.