The frequency-and wave vector-dependent dielectric function $\varepsilon(q,\omega)$ of Si is calculated by using the formulation of the random-phase approximation (RPA). The energy eigenvalues and eigenvectors which are used in the calculations are obtained from the energy-band calculations based on both the ab {\boldmath$initio$} plane wave (PW) and the linear combination of Gaussian atomic orbitals (LCAO) methods. The imaginary part of the dielectric function $\varepsilon_2(q,\omega)$ is calculated directly and the real part of the dielectric function $\varepsilon_1(q,\omega)$ is calculated both by a direct method and by the Kramers-Kronig relation. In the direct calculations of the real part, we assume that a matrix element is constant over one tetrahedron and an average value is taken over the four corners of the tetrahedron. The results are given for q $\rightarrow$ 0 and q = (0.25,0,0), (0.5,0,0), (0.75,0,0) and (1,0,0) (2$\pi$/a) for energies up to about 30 eV. In this $<100>$ direction, the symmetry properties have been exploited to reduce computational efforts. We evaluate $\varepsilon(q\rightarrow0,\omega)$ by taking the q $\rightarrow$ 0 limit in the RPA expression. We also estimate the plasma frequencies using the sum rules and compare with experimental values.