Let $t>0$ be a fixed parameter and $x\in\mathbb{R}$ be an irrational number. I am trying to show that there exists infinitely many rational numbers $\frac{p}{q}$ such that $\left|x - \frac{p}{q}\right|\leq \frac{1}{q^{2 + t}}$. I was told that this claim follows almost immediately from contined fractions. Unfortunately I haven't really worked with continued fractions so I am clueless on how I should prove the result. The tricky part seems to be getting the $t$-dependence right to the upperbound.
An alternative approach would be to maybe use a proof by contradiction and the density of rational numbers, although I don't know what you really can say about the denominator of the rational numbers close enough to $x$.
Mathworker21 and Conrad gave examples showing that the assertion is false. In fact it is false for almost every $x$ according to Lebesgue measure (Of course they know this well, one example suffices to refute a general assertion.) This follows from Khinchin's theorem on metric Diophantine approximation [1], see also [2], [3]. As a special case of this theorem, we find that for every $\epsilon>0$ and almost every real $x$, there are only finitely many rational numbers $p/q$ such that $|x-p/q|< q^{-2-\epsilon}$. The statement in the previous line just uses the easy direction of Khinchin's theorem, which follows immediately from the first Borel-Cantelli Lemma.
[1] A. Khintchine, "Zur metrischen Theorie der diophantischen Approximationen" Math. Z. , 24 (1926) pp. 706–714
[2]https://en.wikipedia.org/wiki/Diophantine_approximation#Khinchin's_theorem_on_metric_Diophantine_approximation_and_extensions
[3] https://carmamaths.org/pdf/retreat2013/retreat2013-mumtaz_hussain.pdf