This might lead us to believe he is crazy from the beginning. Also, when he decides to act mad he could really be trying to cover up that he thinks he is becoming mad on top of wanting to distract his Uncle and mother. This can work whether or not the ghost is real or not.
Sometimes his madness is fake. An example would be when he is having a conversation with Polonius he says, "Slanders, sir: for the satirical rogue says here that old men have gray beards, that their faces are wrinkled, their eyes purging thick amber and plum-tree gum and they have a plentiful lack of wit" (Shakespeare 1634). This is a way we can see that Hamlet was pretending to be mad. He used this as a way of insulting Polonius since what he said described Polonius. A funny part of this is that Hamlet says that Polonius has a lack of wit while Hamlet is actually using his own wit to cause trouble. Another example is when Polonius asks if Hamlet knows who he is and hamlet replies, "Excellent well; you are a fishmonger"" (Shakespeare 1633). This is another way of insulting Polonius. If he did not know who Polonius was he could still have been nice. Hamlet probably knows no fishmongers since he is in the castle all of the time. However, some people who read Hamlet believe that hamlet knew who Polonius was because he was spying off stage, but that is just speculation. This shows that Hamlet has reason and can think clearly. So, at this moment he is not not mad. The idea that there is a ghost in the play does not just affect the beginning. Even though the meeting of the ghost with his friends is not mentioned throughout the rest of the play the ghost is mentioned again when Hamlet is with his mother. He begins talking to the ghost and his mother cannot see the ghost, "No, nothing but ourselves"" (Shakespeare 1663). Here she thinks he is mad because she sees him talking to himself. However, he is not mad since he is talking to the ghost.