Theory of pseudogap and unconventional pairing in the Hubbard model