Step 1: Use the case as a pattern, not just single facts.
Four months of low grade fever that comes and goes, weight loss, and coughing up blood is a long, drawn out picture. That duration alone should shift the first thought toward a chronic infection rather than a quick viral illness.
Step 2: Weigh the Mantoux result.
A 14 x 17 mm induration on the Mantoux test is a strongly positive reaction. In a country where TB is common, this supports past or current exposure to Mycobacterium tuberculosis and fits with active disease when paired with matching symptoms.
Step 3: Do not be fooled by the negative sputum smear.
Smear microscopy misses a fair number of true TB cases, since it needs a high bacterial load to turn positive. A single negative AFB smear is common in early or lower burden disease and should not be used alone to exclude tuberculosis.
Step 4: Check the raised ESR against the differentials.
The raised ESR fits a chronic granulomatous infection like TB well. Viral pneumonia is short lived and would have resolved or clearly worsened within days, not persisted for 4 months. Fungal pneumonia needs a predisposing lung disease or a weak immune system, which is not mentioned here. Bronchogenic carcinoma is rare in a 25 year old with no smoking history given.
Step 5: Settle on the diagnosis.
Putting the fever pattern, weight loss, hemoptysis, strong Mantoux, and raised ESR together, pulmonary tuberculosis remains the best fit despite the negative smear.
\[ \boxed{\text{Pulmonary tuberculosis (PTB)}} \]