The first observation of the B0->J/psi K+K- decay is presented with a data sample corresponding to an integrated luminosity of 1.0/fb of pp collisions at a center-of-mass energy of 7 TeV collected with the LHCb detector. The branching fraction is measured to be B(B0->J/psi K+K-) = (2.53 +/- 0.31 +/- 0.19)x10^{-6}, where the first uncertainty is statistical and the second is systematic. An amplitude analysis of the final state in the B0->J/psi K+K- decay is performed to separate resonant and nonresonant contributions in the K+K- spectrum. Evidence of the a0(980) resonance is reported with statistical significance of 3.9 standard deviations. The corresponding product branching fraction is measured to be B(B0->J/psi a0(980), a0(980)->K+K-)=(4.70 +/- 3.31 +/- 0.72)x10^{-7}, yielding an upper limit of B(B0->J/psi a0(980), a0(980)->K+K-)<9.0x10^{-7} at 90% confidence level. No evidence of the resonant decay B0->J/psiphi; is found, and an upper limit on its branching fraction is set to be B(B0->J/psiphi)< 1.9x10^{-7} at 90% confidence level.