What is a word for someone who tries to be clever?

Insufferable Know-it-all. Quote from Harry Potter and the Prisoner of Azkaban:

Professor Snape: That is the second time you have spoken out of turn, Miss Granger. Tell me, are you incapable of restraining yourself, or do you take pride in being an insufferable know-it-all?


Given your example specifically about small details, you could call them pedantic (Google searched the term "pedant"):

A pedant is a person who is excessively concerned with minor details and rules or with displaying academic learning.


smart al·eck

informal
noun
noun: smart alec
1. a person who is irritating because they behave as if they know everything.
adjective
adjective: smart alec
1. irritating as a result of behaving as if one knows everything.
"a smart-aleck answer"
Oxford Dictionaries


I'll offer the more vulgar and somewhat crass smart arse. From BBC News (today, in fact):

She described the crossword proposal as a "typical" gesture for Mr Dick, who she described as "a smart-arse at the best of times"