-
Threshold bar and there are a lot of nicer options than the one you have pictured. You could get a larger nicer looking one that would hide the poorly trimmed edge. It's not rocket science to fit, just trim to length with a junior hacksaw.
You can pull the carpet out with a screwdriver and you'll probably see how it's fixed to the floor, push it back in with a screwdriver or pry bar preferably.
What is that strip stuff called that goes between 2 rooms with possible different surfaces? In this case it's aluminium but we need a piece for a room in maybe wood or plastic (not sure).