The answer to this is a very mixed answer. The matter of the fact is that Hamlet does have a plan to "act mad" or crazy in front of everyone in order to hide his true intentions to avenge his father's death.
However, it can also be said that Hamlet is a little crazed by the notion that his uncle killed his father and his mother married his uncle, and also the fact that, despite what he has learned at Wittenberg university, the "warlike form" of his father (as Horatio calls the Ghost, I.i) has recently appeared to him and told him of how he died.
The realization of a ghost during the Elizabethan period was not a common aspect to life. Shakespeare wanted to show the distinction and confusion one goes through when they say they are going to act mad, then realize that they are a little mad to begin with.
So, to answer your question, he is a little of both: He is acting in order to get closer to Claudius, but he is crazed because of the circumstances surrounding the state of Denmark and what he needs to do. We can confirm this in V.ii when Hamlet excitedly tells Horatio of how he turned the tables on them and sent them to their deaths: he doesn't perceive the enormity of his murderous deed saying it was guided by a "divinity that shapes" the end results of our plans.
Our indiscretion sometimes serves us well,
When our deep plots do pall: and that should teach us
There's a divinity that shapes our ends,
Rough-hew them how we will,--