If you look to the very end of act one and the beginning of act two, you can find the answer to this one. After the ghost leaves, Hamlet solemnly vows to remember every word the ghost has said, especially concerning revenge. He vows to enact revenge, to do as the ghost bade him to do. He repeats that he will "remember thee," (I.v.95-97) meaning, remember the ghost and what he said. He reassures himself, and the ghost that
"thy commandment all alone shall live within the book and volume of my brain" (I.v.102-3).
So, he will "wipe away all trivial and fond" memories of his father, and remember the ghost only, and what the ghost wanted to do. To best enact his revenge, Hamlet decides to act "strange or odd...to put an antic disposition on" (II.i.170-172) in order to go about gathering clues about his father's death, without rousing suspicion. If everyone thinks that he is crazy and loopy, if he asks strange questions or meddles in suspicious territory, no one will take it seriously, because it's just Hamlet, being crazy again. So, that is the plan that he has to initiate the solemn vow of enacting revenge; he must safely gather information to affirm whether his uncle is guilty or not, so that he can then kill him.
I hope that helped a bit; good luck!