Entering the United States, you'll go through immigration and then TSA security when you arrive at DFW (unless you are coming from a Preclearence airport, where you'll go through US immigration and customs before you fly).
Arriving at DFW on your way in, you'll go through immigration, baggage claim (where you must pick up any checked luggage), customs, baggage-drop off (where you'll return any checked luggage for your next flight), and security before heading to your gate for the flight to Pittsburgh.
Leaving the US, you will not have to pass through immigration at all, and would only have to go through security at your first airport unless you need to change terminals and the airport in question doesn't have a way to do that within the secure area. In your case, you will not need to go through security again while leaving, as DFW and ORD allow you to move between terminals without exiting the secure area (setting aside ORD's terminal 5 bus situation, which won't apply here).
- On your way into the US: immigration, customs, and security at DFW, nothing at PIT
- On your way out of the US: security at PIT, nothing at ORD or DFW