Are there any units involved in the partition function for a classical particle system? Is the output of a partition function dimensionless or are there units involved?
The question as it is:
$$E_1\text{=0}K_B\text{,g=1}$$
$$E_2\text{=0}K_B\text{,g=3}$$
$$E_3\text{=0}K_B\text{,g=5}$$
My solution is:
$$\text{Z =
   (1)}e^{(0)}\text{+(3)}e^{\left(\frac{-300K_B}{K_B(300K)}\right)}+5e^{\left(\frac{-600
   K_B}{K_B(300K)}\right)}$$
Notice that after the cancellation, I am left with the reciprocal of K(Kelvin). 
 A: Start from the general definition, how this thing is set up in practice:
You start from the mean energy of a system in contact with a thermal reservoir. The systems of the representative statistical ensemble are distributed over the entire number of possibilities, in accordance with the canonical ensemble
$$P_i = C \exp(-\beta E_i) = \frac{\exp(-\beta E_i)}{\sum_i \exp(-\beta E_i)}$$
The mean energy in this case is given in the usual manner:
$$ {\bar E} = \frac{E_i \sum_i \exp(-\beta E_i)}{\sum_i \exp(-\beta E_i)}$$
where $i$ covers all accessible states of the system. Then one states that it shall be easier to write this by observing that 
$$E_i \exp(-\beta E_i) = - \sum \frac{\partial}{\partial \beta} \left( \exp(-\beta E_i) \right) = - \frac{\partial {\mathbb Z}}{\partial \beta} $$
where 
$${\mathbb Z} = \sum_i \exp(-\beta E_i)$$
This is how partition function is introduced. Therefore, it is a sum of exponentials, each of whom is dimensionless. (To see the latter, just observe the definition of $\beta$, I'm not going to do your homework!) Thus, the partition function is dimensionless. 
To answer the rest of your question, let us invert the argument. Suppose the partition function wasn't dimensionless. Suppose I make a perturbation to the system and the energy levels all displace by a small amount. If $\delta E$ is small, I can try expanding the exponentials, using $e^x = 1 + x + x^2/2 + \ldots$. Then, I would reach an inconsistency of dimensions, which is prohibited by the principle of homogeneity of dimensions.
