To answer the last question first: any bijection between the two sets would do, but in this case it’s easiest by far to write down a linear bijection.
Your two sets are $]2,5]$ and $[3,4[$. Note that while the first interval is open on the left and closed on the right, the second is exactly the opposite: open on the right and closed on the left. The easiest way to match them up is to turn one of them around. I’ll turn round the second. That means that I want to pair $5$, the closed end of the first interval, with $3$, the closed end of the second interval, and $2$, the open end of the first interval, with $4$, the open end of the second interval.
2 x 5 )--------------------------| 4 y 3
As $x$ increases from $2$ to $5$, I want $y$ to decrease from $4$ to $3$. In other words, I’m looking for the equation of a straight line that passes through the points $(2,4)$ and $(5,3)$. That means that $y$ has to drop by $1$ while $x$ increases by $3$, so the line has a slope of $-\frac13$ and passes through $(2,4)$. The standard point-slope form of the equation for a straight line gives us $y-4=-\frac13(x-2)=-\frac13x+\frac23\;,$ so $y=-\frac13x+\frac{14}3=\frac13(14-x)\;.$
If you draw a graph of this straight line, you’ll see that it maps the interval $]2,4]$ $1$-$1$ onto the interval $[3,4[$. In other words, it’s a bijection between those intervals, and its existence shows that they are equipotent.