Star formation and chemical enrichment histories of galaxies are imprinted in their internal structures of galaxies, i.e., kinematics and elemental abundances of stars within galaxies. We predict the distribution of elements within galaxies using our chemodynamical simulations. In the simulated Milky Way-type galaxies, the bulge formed though assembly of gas-rich galaxies at high-redshifts, and has old, metal-rich, and alpha-enhanced populations. The disk formed inside-out over Cosmic time, producing [alpha/Fe]-[Fe/H] relations. A half of thick disk stars have formed in satellite galaxies. In each component, the scatter in elemental abundance ratios is caused by this accretion as well as migration and in-situ variation of chemical enrichment. In cosmological simulations, the feedback from active galactic nuclei (AGN) plays an essential role in questing star formation in massive galaxies and re-distributing metals into the intergalactic medium. We have applied a new AGN model for the formation of black holes motivated by the first star formation, in contrast to the merging scenario of previous works. Our simulations reproduce the observed cosmic star formation rates, black hole mass-galaxy mass relation, size-mass relation, and mass-metallicity relation of galaxies, and are in better agreement with the observed down-sizing phenomena, namely, the alpha enhancement of early-type galaxies. We also predict the time evolution of these relations and the metallicity radial gradients. At present, stellar metallicity gradients dramatically evolve depending on their merging histories, while gas-phase metallicity gradients are more sensitive to the AGN feedback.