Let $\epsilon > 0$ , be a positive number
To find a $\delta$ such that $|x-3|<\delta$ implies $|f(x)-f(3)|<\epsilon$.
Case-I if $x\in \mathbb Q$
Then $|f(x)-f(3)|=|x^2-9|=|(x-3)(x+3)|$
Therefore we choose our $\delta$ to be $<1$, then $|x-3|<1$ implies $-1<x-3<1$ , adding 6 on both sides we get $
x+3<7$.
$|f(x)-f(3)|=|x^2-9|=|(x-3)(x+3)|<|x-3|\cdot 7$
Therefore we can choose, $\delta $ to be $\dfrac{\epsilon}{7}$ for the case-I
Case-II , $ x $ is irrational number,
$|f(x)-f(3)|=|3x-9|=|3(x-3)|$
Therefore we can choose, $\delta $ to be $\dfrac{\epsilon}{3}$ for the case-II
So, for all real $x$ we can choose $$\delta= min\{1,\frac{\epsilon}{7}, \frac{\epsilon}{3} \}$$ which ends the proof of $f$ being continuous at 3.
Note: 1) For a better and clear understanding of manipulation of $\delta $
you can refer to this beautifully written answer which got 27 upvotes-How to show that $f(x)=x^2$ is continuous at $x=1$?