Q:"If I purchased official licensed merchandise and resell it. Is that legal?
A: Yes if unmodified and separately sold. This is known as "exhaustion of rights" or "doctrine of first sale" so you can Google the terms to find out more.
Q:"If I pair it with homemade or other purchase items would that make a difference? "
A: That is called "piggybacking" and is usually a violation of trademark rights.
Q:"For example, if I sold a mug that I made with a "Justin Beiber" T-shirt inside, Could I do that as long as I purchase the T-shirt from an official distributor?
A: Not unless your mug is licensed. This is roughly equivalent to just pasting "Justin Bieber" on your mug. This is Trouble with a capital T for trademark, even
Q:"Also does anything change if the logo or name used is publically known BUT not trademarked officially?"
A: No, not much. Trademark right are based on public use and notoriety, not registration. A registered mark is more easily asserted, but unregistered marks and celebrity names are still rather easily protected against deliberate infringers like you propose to be. Judges do not act kindly toward rip-off artists and free-riders. Google "Victoria Espinel" and see if stopping counterfeiting has a high profile within the US Government [she works at the White House and reports to the Director of the OMB]
Bottom Line: Don't do this unless you have a death wish for your business and perhaps your personal assets. This is a non-starter and would be extremely risky and foolish.
I am not your lawyer and you are not my client. Free advice here is without recourse and any reliance thereupon is at your sole risk. This is done without compensation as a free public service. I am licensed in IL, MO, TX and I am a Reg. Pat. Atty. so advice in any other jurisdiction is strictly general advice and should be confirmed with an attorney licensed in that jurisdiction.
A trademark does not have to be "officially" registered to be enforceable, although registration is highly recommended. The issue will be whether your use of the logo or name causes consumer confusion with another user. I would recommend consulting an Intellectual Property attorney to help you avoid an unexpected lawsuit before you invest a lot of time and money in your venture.
This is general information and not meant as specific legal advice for any particular situation.