An infinite square well is a region with constant potential energy (inside the well) surrounded by a region of infinite potential energy (outside the well). Therefore, it is impossible for a particle to be outside of the well, hence the edge of the wells are nodes. Therefore, the wavefunctions are simple harmonic oscillators, which can be proved by solving the Schrodinger's equation.