"An idea" is grammatically correct. It's an example of a "singular noun." English has both singular and plural nouns, and the difference between them is whether or not the word refers to one or more than one thing. The word idea should not be preceded with "a".