Is it possible to solve this ODE for $y$? According to wikipedia this falls in the category of a first order, linear, inhomogeneous ODE with function coefficients. But is there a more tractable general solution than the one offered on that page?
The ODE is:
$$\frac{dy}{dt}f(t)+y \:g(t)=h(t)$$
where the LHS is just the product rule for $\frac{d}{dt}\left(y(t)f(t)\right)$, and so:
$$g(t)=\frac{df}{dt}$$
and it is also known that $$h(t)=\frac{t\:q(t)}{f(t)}$$
The integrating factor method is often successful in finding explicit closed-form solutions of standard problems. But, for certain problems other methods are known. Pfaff's Theorem states that there exists an integrating factor $I$ (not necessarily the standard one as discussed in the elementary DEqns course) which makes a first order ODE exact. However, finding $I$ is as difficult as finding the solution to the DEqn of interest. So, generically speaking one hopes for a clever substitution to appear since deriving the substitution is as hard as the problem itself. That said, I think this problem is more about integration than some other technique.
For your problem, if I assume $q=g$ (which may be mere wishful thinking on my part) then your problem becomes: $$ \frac{d}{dt} [ yf ] = \frac{t}{f}\frac{df}{dt} $$ But, we can write this as, $$ \frac{d}{dt} [ yf ] = t\frac{d}{dt} \ln(f) $$ Well, this is a lovely formula, I can integrate it and with the technique of integration by parts derive a nice solution up to an integral for the given problem, $$ yf = t\ln(f)-\int \ln(f) dt $$ hence, $$ y = \frac{1}{f} \biggl( t\ln(f)-\int \ln(f) dt +C \biggr). $$