Hamlet's "antic dispostion" ("antic" should be understood as the archaic meaning, "a grotesque theatrical presentation.") Hamlet feels it is necessary to assume this mask in order to find out what has truly happened to his father.
There are a couple of reasons why Hamlet feels an "antic dispostion" is necessary. First, he is not completely sure what the Ghost has told him is true. In these lines, he voices his doubts: ""The spirit that I have seen May be a devil, and the devil hath power T' assume a pleasing shape" (2.2.627-629).
Without any proof other than the Ghost's accusations, Hamlet does not feel that he can carry out its orders. He needs more hard evidence before he can carry out a murder, something he finds reprehensible and does not want to do.
Hamlet's decision to don the mask of insanity is really quite clever (though some argue it cowardly). It allows him to gather information surruptitiously and should he be perceived by anyone in the court (or elsewhere) as crazy, his actions would be chalked up to being mad.