Why is the Sun approximated as a black body at ~ 5800 K?
- Yes - the integral of the spectrum you refer to gives the total power per unit area emitted from the surface of the sun. If you multiply that by a factor of $\left(\frac{\text{Solar Radius}}{1\text{ AU}}\right)^2$ to account for the $1/r^2$ dependence of intensity on distance, then you'll get the solar constant you quote.
- Yes. The sun is not at a single uniform temperature - the radiation which reaches Earth is mostly emitted from the photosphere (~6000 K) but the temperature varies dramatically between the different layers of the sun.
Source
- Everywhere. The sun is very nearly an ideal black body. This is a property of the sun, not of a particular vantage point from which you're observing it. Furthermore, atmospheric effects dramatically change measurements of the solar spectrum on Earth.
The upper atmosphere blocks nearly all of the radiation at higher frequencies than UV, and quite a lot of the IR spectrum is absorbed and scattered by greenhouse gases. Visible light passes through without much trouble (which is a substantial part of why we evolved to be sensitive to those frequencies) but the facts that the sky is blue and that sunsets are beautiful demonstrate that the atmosphere scatters visible light as well.
Source
As a complement to the other answers, I'd like to point out that if you measure the solar spectrum at a very high resolution, you see very large variations in spectral radiance over very short wavelength scales. Here is a figure that I made for my PhD thesis to illustrate this:
A high resolution solar spectrum (source here) is plotted in grey and the same spectrum with degraded resolution is plotted in black. The lower panels show close-ups of smaller wavelength regions. This is the solar spectrum as seen from space, i.e. there are no effects from Earth's atmosphere present.
These variations are due to a multitude of absorption lines (normally referred to as Fraunhofer lines) caused by absorption from gases in the colder outer parts of the photosphere (and to some extent in the chromosphere).
Hence, the ~5800 K black body spectrum is not a good description of the solar spectrum at very fine wavelength scales. But it's a reasonable approximation on larger scales.
The solar constant ($S$) is the energy received per unit area perpendicular to the rays at 1 AU distance (see wikipedia). Thus, mathematically, it represents the total energy emitted by the sun divided by the surface area of a sphere with a radius of $R$=1 AU: $$S=\frac{P_{emitted}}{4\pi R^2}$$ Usually, one can use the Stefan-Boltzman law to compute $P_{emitted}=\sigma T^4\times A_{Sun}$ by the sun which is considered a black body here and where $A_{Sun}$ is the total area of the sun's surface, $\sigma$ the Stefan-Boltzmann constant and $T$ the black body's surface temperature. So: $$S=\sigma T^4\left(\frac{R_{Sun}}{R}\right)^2\approx1380W/m^2$$ By plugging numbers: $R=$1AU$=150\times 10^9m$, $R_{Sun}=6.957\times 10^8m$, $T=5800K$ and $\sigma=5.67\times 10^{-8}W/m^2K$, we get approximately the same Solar constant.
The definition of a black body is a body that absorbs all incoming radiations and that emits light solely due to it's temperature. In astronomy, since stars are really shiny objects and that they are really distant from each other, they can be considered black bodies since we approximate that the light we get from them is almost entirely emitted by their surface and is not reflected light from another star. In other words, they are approximated by black bodies because we can be pretty sure that the light they emit is solely due to their temperature. Approximating the sun as a black body effectively means that it's surface temperature is 5800K. And, indeed, if we look at the most dominant wavelength of the sun spectrum, the maximal intensity comes from green wavelength which corresponds to a black body emitting radiation at a temperature of 5800K. For more info look at the Wien's displacement law.
The sun is considered a black body, not only from the perspective of the Earth but from any perspective. The sun's intensity spectrum is roughly the one of a perfect black body minus absorption by the sun's atmosphere and the Earth's atmosphere depending of where we measure the spectrum. See the sunlight article on wikipedia.