BUG: groupby apply raises ValueError when groupby axis has duplicates and applied identity function
This is a more of a patch than a complete solution to this groupby apply paradigm. 
When there are duplicates in the groupby axis, we restore the axis to its original order, but not guaranteeing that the order of the data with the same axis values is restored.

- [x] closes #30667
- [x] tests added / passed
- [x] passes `black pandas`
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

Restarted the failing travis build  Hello @fujiaxiang! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:





There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2020-01-20 13:53:25 UTC ping All tests passed on my local machine which has the most recent master merged. Don't know why this fails. I see many other PRs also failing. Is this a CI issue? The CI process keeps failing. Can anyone tell me how I can retrigger CI without pushing new commits? thanks @fujiaxiang very nice.

so a more longer term solution would be for ``Index.reindex(...)`` to handle duplicates (rather than raising), via a new keyword (e.g. errors='raise' or errors='coerce'`), though maybe have to think about the api a bit. this might be a fairly big change though.