If $A$ is a non-unital $C^*$-algebra then $\widehat {A}$ can never be compact with respect to the Gelfand topology. 
Let $A$ be a non-unital $C^*$-algebra. Let $\widehat {A}$ be the space of all non-zero multiplicative linear functionals on $A$ endowed with the Gelfand topology. Then $\widehat {A}$ is locally compact but not compact.

I can show that $\widehat {A}$ is locally compact since we can take a closed ball around it which is weak* -compact by Banach-Alaoglu theorem. Also since $A^{\ast}$ is Hausdorff with respect to weak* topology it follows that $\widehat {A}$ is also Hausdorff with respect to the Gelfand topology. I have also shown that $\widehat {A^+}$ is homeomorphic to $\widehat {A} \cup \{\phi_{0}\}$ where $A^+$ is the unitization of $A$ and $\phi_{0}$ is the zero linear functional on $A.$ Therefore we can conclude that $\widehat {A} \cup \{\phi_{0}\}$ is compact with respect the induced weak* topology. But I can't able to show that $\widehat {A}$ can never be compact unless $A$ is unital. In case $A$ is unital, $\widehat {A}$ is compact being a closed subset of the unit ball which is weak*-compact. But how to deal with the situation if $A$ is non-unital? Any help or suggestion in this regard would be warmly appreciated.
Thanks a bunch.
 A: For the commutative case, your claim is true: $\widehat{C_0(X)}$ is homeomorphic to $X$ and $C_0(X)$ is unital iff $X$ is compact.
For the non-commutative case, there are counter-examples.
Take any non-unital, simple $C^*$-algebra with dimension at least 2, for example the compact operators over an infinite dimensional Hilbert space $K(H)$. If $\phi:K(H)\to\mathbb{C}$ is a *-homomorphism, then $\ker(\phi)$ is a closed, two sided ideal. Since $K(H)$ is simple, $\phi=0$ or $\ker(\phi)=0$. If $\ker(\phi)=0$, then $\phi$ is injective and thus $K(H)$ is one dimensional, which is false. So there exist no non-zero *-homomorphisms $K(H)\to\mathbb{C}$, i.e. $\widehat{K(H)}=\emptyset$.
Do you consider the empty set as a non-compact space? No problem, here is another one:
consider $A=K(H)\oplus \mathbb{C}$ (coordinate wise operations and supremum norm on coordinates). This is a non-unital $C^*$-algebra and we have natural inlcusions (i.e. injective $*$-homomorphisms) $K(H)\subset K(H)\oplus \mathbb{C}$ and $\mathbb{C}\subset K(H)\oplus\mathbb{C}$. Now if a non-zero $*$-homomorphism $\phi:K(H)\oplus\mathbb{C}\to\mathbb{C}$ exists, then $\phi\vert_{K(H)}=0$, by the preceding paragraph. Also, $\phi\vert_{\mathbb{C}}$ is a $*$-homomorphism on $\mathbb{C}$ so $\phi\vert_\mathbb{C}=0$ or $\phi\vert_{\mathbb{C}}=\text{id}$, and since we want $\phi$ to be non-zero, we must have $\phi\vert_{\mathbb{C}}=\text{id}$. In other words, there exists a unique non-zero $*$-homomorphism $K(H)\oplus\mathbb{C}\to\mathbb{C}$, namely $(x,\lambda)\mapsto\lambda$ and thus $\widehat{A}$ is a singleton. Whatever topology you put on a singleton, it has to be compact and not just locally compact. You can also take more copies of $\mathbb{C}$ in your direct sum and make non-unital $C^*$-algebras with maximal ideal space being finite sets (thus compact) and have larger cardinality.
To conclude: you claim that a $C^*$-algebra is unital if and only if its maximal ideal space is compact. For the commutative case this is true, for the non-commutative case this is false.
