We use gauge theoretic and algebraic methods to examine sufficient conditions for smooth points on the moduli space of flat connections on a compact manifold and on the character variety of a finitely generated and presented group. We give a complete proof of the slice theorem for the action of the group of gauge transformations on the space of flat connections. Consequently, the slice is smooth if the second cohomology of the manifold with coefficients in the semisimple part of the adjoint bundle vanishes. On the other hand, we find that the smoothness of the slice for the character variety of a finitely generated and presented group depends not only on the second group cohomology but also on the relation module of the presentation. Howeve...